Graphics Reference
In-Depth Information
private CarController_MVD car2;
private int focusPlayerRacePosition;
public GameObject count3;
public GameObject count2;
public GameObject count1;
public GUIText finalPositionText;
public GameObject [] playerPrefabList;
[System.NonSerialized]
public static GameController_MVD Instance;
public Waypoints_Controller WaypointControllerForAI;
// scale time here
public float gameSpeed = 1;
private bool didInit;
public GameObject wrongWaySign;
private bool oldIsWrongWay;
public GameController_MVD ()
{
Instance = this;
}
void Start ()
{
Init();
}
void Init ()
{
// in case we need to change the timescale, it gets set here
Time.timeScale = gameSpeed;
// tell race manager to prepare for the race
GlobalRaceManager.Instance.InitNewRace( totalLaps );
// initialize some temporary arrays we can use to set up the
// players
Vector3 [] playerStarts = new Vector3 [numberOfRacers];
Quaternion [] playerRotations = new Quaternion [numberOfRacers];
// we are going to use the array full of start positions that must
// be set in the editor, which means we always need to make sure
// that there are enough start positions for the number of players
for ( int i = 0; i < numberOfRacers; i++ )
{
// grab position and rotation values from start position
// transforms set in the inspector
playerStarts [i] = (Vector3) startPoints [i].position;
playerRotations [i] = ( Quaternion ) startPoints [i].rotation;
}
Search WWH ::




Custom Search