@@ -17,7 +17,7 @@ namespace EnemyAI
public void Update()
{
- EnemyAI.Result result = currentBehavior.Run(ref blackboard);
+ EnemyAI.Result result = currentBehavior.Run(ref blackboard);
}
@@ -1,7 +1,5 @@
using System.Collections;
using System.Collections.Generic;
-using UnityEngine;
-
namespace EnemyAI
@@ -12,5 +10,9 @@ namespace EnemyAI
get;
set;
+
+ public UnityEngine.AI.NavMeshAgent navMeshAgent;
+ public UnityEngine.Vector3 PlayerPosition;
@@ -0,0 +1,21 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+namespace EnemyAI
+{
+ internal class ChaseBehavior : Behavior
+ {
+ internal override Result Run(ref Blackboard blackboard)
+ blackboard.navMeshAgent.destination = blackboard.PlayerPosition;
+ if (!blackboard.Night)
+ return Result.Success;
+ }
+ return Result.Running;
+}
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 0f51372775b4ade4097160ae7e987f21
+timeCreated: 1501346905
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
@@ -1,6 +1,5 @@