Beispiel #1
0
    void HandleGameStateChanged(GameManager.GameState currentState, GameManager.GameState previousState)
    {
        Debug.LogFormat("Game state {0}", currentState.ToString());

        dummyCamera.gameObject.SetActive(currentState == GameManager.GameState.PREGAME);
        bootMenu.SetActive(currentState == GameManager.GameState.PREGAME);

        mainMenu.gameObject.SetActive(currentState == GameManager.GameState.INMENU);

        inGameUI.gameObject.SetActive(currentState == GameManager.GameState.RUNNING);

        pauseMenu.gameObject.SetActive(currentState == GameManager.GameState.PAUSED);

        gameOverMenu.gameObject.SetActive(currentState == GameManager.GameState.GAMEOVER);
    }
 private void CurrentGameStatus(GameManager.GameState g)
 {
     if (showDebugMsg)
     {
         Debug.Log("game over: " + g.ToString());
     }
     if (g == GameManager.GameState.gameOver)
     {
         hellBGM.Stop();
         normalBGM.Stop();
     }
     else if (g == GameManager.GameState.gameStarted && !musicInitialized)
     {
         hellBGM.Stop();
         normalBGM.Stop();
         currentBGMRef.time = 0;
         currentBGMRef.Play();
         musicInitialized = true;
     }
 }