public void Update(FollowAgent agent) { bool shouldFollowTarget = agent.ReachedTargetFollowingThreshold(); if (shouldFollowTarget) { agent.GetNavMeshAgent().destination = agent.GetFollowTarget().transform.position; } else { SwitchToPatrolState(agent); } }
public void Update(FollowAgent agent) { bool shouldFollowTarget = agent.ReachedTargetFollowingThreshold(); if (shouldFollowTarget) { SwitchToFollowTargetState(agent); } else { if (agent.GetPatrolCheckpoints().Length != 0) { PerformPatrol(agent); } } }