void GotoGameOverScreen() { Clear(); PlaySound(GameOverSound); HUD.gameObject.SetActive(false); GameOverScreen.Init(CurrentLevelIndex, Purse.Value, GotoWelcomeScreen); GameOverScreen.Overlay.Show(); }
////////////////////////////////////////// /// GameOver() /// Effectively ends the game in victory /// or defeat. ////////////////////////////////////////// private void GameOver(bool i_bVictory) { m_bGameOver = true; GameObject goGameOver = gameObject.InstantiateUI(GameOverScreen); GameOverScreen script = goGameOver.GetComponent <GameOverScreen>(); script.Init(i_bVictory); }
public void GameOver(string reason) { if (!GameController.Instance.isGameover) { GameController.Instance.isGameover = true; gameoverScreen.gameObject.SetActive(true); string currentTime = (Mathf.Round(Time.time * 100f) / 100f).ToString(); gameoverScreen.Init(reason, currentTime); } }