//call after next level button, restart button public void LevelReset(GameObject caller) { SetCurrentScore(0); gameState = States.GameState.InGame; gameMenu.newHighscoreNotification.SetActive(false); gameMenu.winMenu.SetActive(false); gameMenu.loseMenu.SetActive(false); }
void Init() { //todo load save if any default to 0 highScore = Load(); gameState = States.GameState.MainMenu; //for menu AddEventListeners(); }
public void LevelLost(GameObject caller) { gameState = States.GameState.LoseGame; gameMenu.livesText.text = "Game Over!"; // todo load highscore data gameMenu.loseHighScoreText.text = "HighScore:\n" + highScore; gameMenu.loseMenu.SetActive(true); }
public void BackToMenu(GameObject caller) { SetCurrentScore(0); gameState = States.GameState.MainMenu; gameMenu.newHighscoreNotification.SetActive(false); gameMenu.winMenu.SetActive(false); gameMenu.loseMenu.SetActive(false); gameMenu.pausedMenu.SetActive(false); StartCoroutine(LoadScene(menuScene)); }
public void LevelWon(GameObject caller) { // do we have a new highscore? if (currentScore > highScore) { SetNewHighScore(currentScore); EventBus.Broadcast(EVENT.NewHighScore, gameObject); } gameState = States.GameState.WinGame; gameMenu.winHighScoreText.text = "HighScore:\n" + highScore; gameMenu.winMenu.SetActive(true); }
public void Play(GameObject caller) { StartCoroutine(LoadScene(gameScene)); gameState = States.GameState.InGame; }
public void LevelUnPaused(GameObject caller) { gameState = States.GameState.InGame; gameMenu.pausedMenu.SetActive(false); }
public void LevelPaused(GameObject caller) { gameState = States.GameState.Paused; gameMenu.pausedMenu.SetActive(true); }