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); } }
private Vector3 GetCurrentWaypoint() { return(patrolPath.GetWaypoint(currentWaypointIndex)); }