Пример #1
0
 // Use this for initialization
 void Start()
 {
     if (route == null || route.Destination != Destination)
     {
         WaypointNode closest = WaypointNode.GetClosest(transform.position);
         if (closest == null)
         {
             route = new WaypointRoute(this, Destination);
         }
         else
         {
             route = new WaypointRoute(this, closest.GetRouteTo(Destination));
         }
         route.NextWaypointReachedEvent  = NextWaypointReachedEvent;
         route.FinalWaypointReachedEvent = FinalWaypointReachedEvent;
     }
 }