/** * Initialization **/ void Awake() { //set the singleton accessor _i = this; //add game modes to list gameModes.Add("LandMode", new GameMode_LandMode()); gameModes.Add("SpaceShipBridge", new GameMode_SpaceShipBridge()); gameModes.Add("MainMenu", new GameMode_MainMenu()); //Run each modes Awake method foreach (GameMode_Base mode in gameModes.Values) { mode.SetupAwake(); } }
void OnDestroy() { //remove singleton accessor _i = null; }