// Update is called once per frame public virtual void Update() { if (Vector3.Distance(NavAgent.destination, transform.position) < WANDER_GIMME) { NavAgent.ResetPath(); } CurrentTask.Update(this); }
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); } }