public void Patrol()
        {
            moveController.SetMovespeed(patrolMovespeedFraction);
            Vector3 nextPosition = startPosition;

            if (patrolPath != null)
            {
                if (AtWayPoint())
                {
                    timeSinceArrivedAtWaypoint = 0;
                    CycleWaypoint();
                }

                nextPosition = patrolPath.GetWaypoint(currentWaypointIndex);
            }
            if (timeSinceArrivedAtWaypoint > waypointDwellTime)
            {
                moveController.StartMove(nextPosition, patrolMovespeedFraction);
            }
        }
Exemplo n.º 2
0
 private Vector3 GetCurrentWaypoint()
 {
     return(patrolPath.GetWaypoint(currentWaypointIndex));
 }