public MenuCreditState() { uiObjectsContainer = UIObjectsContainer.getInstance(); if (uiObjectsContainer == null) Debug.LogError("ERROR: uiObjectsContainer is null"); credits = uiObjectsContainer.go_creditText.GetComponent<Credits>(); manager = Applicationmanager.GetInstance(); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
private void StartState() { switch (_state) { case "MainMenu": _menu = new MainMenu(this); AddChild(_menu); break; case "HighScores": _scores = new HighScores(this); AddChild(_scores); break; case "Credits": _credits = new Credits(this); AddChild(_credits); break; case "Level1": _level1 = new Level1(this); AddChild(_level1); break; case "Level2": _level2 = new Level2(this, 5); //Would have _lives instead of 5 if pickups were implemented AddChild(_level2); break; case "Level3": _level3 = new Level3(this, 5); //Idem ditto AddChild(_level3); break; case "WonGame": _wonGame = new WonGame(this); AddChild(_wonGame); break; case "Exit": Environment.Exit(0); break; default: throw new Exception("You tried to load a non-existant state"); } }
void creditsEnded(Credits c) { Debug.Log("Credit roll finished!"); }