Exemple #1
0
    public void Update(FollowAgent agent)
    {
        bool shouldFollowTarget = agent.ReachedTargetFollowingThreshold();

        if (shouldFollowTarget)
        {
            agent.GetNavMeshAgent().destination = agent.GetFollowTarget().transform.position;
        }
        else
        {
            SwitchToPatrolState(agent);
        }
    }
Exemple #2
0
    public void Update(FollowAgent agent)
    {
        bool shouldFollowTarget = agent.ReachedTargetFollowingThreshold();

        if (shouldFollowTarget)
        {
            SwitchToFollowTargetState(agent);
        }
        else
        {
            if (agent.GetPatrolCheckpoints().Length != 0)
            {
                PerformPatrol(agent);
            }
        }
    }