コード例 #1
0
 //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);
 }
コード例 #2
0
 void Init()
 {
     //todo load save if any default to 0
     highScore = Load();
     gameState = States.GameState.MainMenu;
     //for menu
     AddEventListeners();
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 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));
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 public void Play(GameObject caller)
 {
     StartCoroutine(LoadScene(gameScene));
     gameState = States.GameState.InGame;
 }
コード例 #7
0
 public void LevelUnPaused(GameObject caller)
 {
     gameState = States.GameState.InGame;
     gameMenu.pausedMenu.SetActive(false);
 }
コード例 #8
0
 public void LevelPaused(GameObject caller)
 {
     gameState = States.GameState.Paused;
     gameMenu.pausedMenu.SetActive(true);
 }