Пример #1
0
    private void Patrol(EnemyStateController controller)
    {
        controller.NavAgent.Resume();

        if (controller.NavAgent.path.reachedDestination)
        {
            controller.NavAgent.waypointIndex = (controller.NavAgent.waypointIndex + 1) % controller.NavAgent.waypoints.waypoints.Count;
            controller.NavAgent.NextWaypoint();
        }

        controller.SetWaypointLocation();
    }