Graphics Reference
In-Depth Information
public int GetCurrentWaypointNum ()
{
return currentWaypointNum;
}
currentWaypointDist is a floating point variable containing the current distance from
the player to its current waypoint in 3D units. The GetCurrentWaypointDist() simply
returns its value as a float:
public float GetCurrentWaypointDist ()
{
return currentWaypointDist;
}
GetIsFinished() and GetIsLapDone() both return Boolean values and will be used by
the global race manager:
public bool GetIsFinished ()
{
return isFinished;
}
public bool GetIsLapDone ()
{
return isLapDone;
}
When the game starts or stops, the global race manager will call the UpdateRaceState
function to tell this script whether or not the race is running:
public void UpdateRaceState( bool aState )
{
raceRunning= aState;
}
The waypointManager (of type Waypoints_Controller) is set up in this function,
which is called by the game controller to pass in the waypoints to use for race position/
progress tracking.
public void SetWayController ( Waypoints_Controller aControl )
{
waypointManager= aControl;
}
The current waypoint transform may be retrieved by a call to GetWaypoint-
Transform(). If there is no transform already in the currentWaypointTransform variable,
this function will detect that and retrieve the transform from the waypointManager object:
public Transform GetWaypointTransform ()
{
// if we have no waypoint transform already 'in the system'
// then we need to grab one
if(currentWaypointTransform==null)
{
currentWaypointNum=0;
Search WWH ::




Custom Search