Exemple #1
0
 // Update is called once per frame
 public virtual void Update()
 {
     if (Vector3.Distance(NavAgent.destination, transform.position) < WANDER_GIMME)
     {
         NavAgent.ResetPath();
     }
     CurrentTask.Update(this);
 }
Exemple #2
0
 private void GoToNextPoint()
 {
     if (pathQueue.Count > 0)
     {
         Ap -= 1;
         Vector3 aim = pathQueue.Pop();
         NavAgent.SetDestination(aim);
         NavMeshPath path = new NavMeshPath();
         NavAgent.CalculatePath(aim, path);
         Controller.Walk(true);
     }
     else
     {
         NavAgent.ResetPath();
         Controller.Walk(false);
     }
 }