Graphics Reference
In-Depth Information
using System.Collections;
public class GlobalRaceManager : ScriptableObject
{
public int totalLaps;
private int currentID;
private Hashtable raceControllers;
private Hashtable racePositions;
private Hashtable raceLaps;
private Hashtable raceFinished;
private int numberOfRacers;
private int myPos;
private bool isAhead;
private RaceController tempRC;
private RaceController focusPlayerScript;
private bool raceRunning;
private static GlobalRaceManager instance;
public static GlobalRaceManager Instance
{
get
{
if (instance == null)
{
instance = ScriptableObject.CreateInstance
<GlobalRaceManager>();
}
return instance;
}
}
public void OnApplicationQuit ()
{
instance = null;
}
public void InitNewRace( int howManyLaps )
{
// initialize our hashtables ready for putting objects into
racePositions= new Hashtable();
raceLaps= new Hashtable();
raceFinished= new Hashtable();
raceControllers= new Hashtable();
totalLaps= howManyLaps;
}
public int GetUniqueID(RaceController theRaceController)
{
// whenever an id is requested, we increment the ID counter.
// This value never gets reset, so it should always return a
// unique id (NOTE: these are unique to each race)
currentID++;
Search WWH ::




Custom Search