public void SetWayController(Waypoints_Controller aControl) { myWayControl = aControl; aControl = null; // grab total waypoints totalWaypoints = myWayControl.GetTotal(); // make sure that if you use SetReversePath to set shouldReversePathFollowing that you // call SetReversePath for the first time BEFORE SetWayController, otherwise it won't set the first waypoint correctly if (shouldReversePathFollowing) { currentWaypointNum = totalWaypoints - 1; } else { currentWaypointNum = 0; } Init(); // get the first waypoint from the waypoint controller currentWaypointTransform = myWayControl.GetWaypoint(currentWaypointNum); if (startAtFirstWaypoint) { // position at the currentWaypointTransform position myTransform.position = currentWaypointTransform.position; } }
public virtual void SetWayController(Waypoints_Controller aWaypointControl) { if (AIController == null) { Init(); } // pass this on to our waypoint controller, so that it can follow the waypoints AIController.SetWayController(aWaypointControl); }
public void SetWayController(Waypoints_Controller aControl) { if (aControl == null) { return; } myWayControl = aControl; // grab total waypoints totalWaypoints = myWayControl.GetTotal(); if (shouldReversePathFollowing) { currentWaypointNum = totalWaypoints - 1; } else { currentWaypointNum = 0; } if (myWayControl.Closed) { loopPath = true; } else { loopPath = false; } Init(); // get the first waypoint from the waypoint controller currentWaypointTransform = myWayControl.GetWaypoint(currentWaypointNum); if (startAtFirstWaypoint) { // position at the currentWaypointTransform position myTransform.position = currentWaypointTransform.position; } }
public void SetWayController(Waypoints_Controller aControl) { raceControl.SetWayController(aControl); }
public void SetWayController(Waypoints_Controller aControl) { waypointManager = aControl; }
public void ClearWayController() { myWayControl = null; }