Ejemplo n.º 1
0
    void Update()
    {
        sfxState = StaticStatesAndVariables.SfxState;
        bgmState = StaticStatesAndVariables.BgmState;

        switch (gameState)
        {
        case GameStates.Running:
            UIRunning.Show();
            UIPause.Hide();
            UIGameOver.Hide();
            break;

        case GameStates.Paused:
            UIRunning.Hide();
            UIPause.Show();
            UIGameOver.Hide();
            break;

        case GameStates.GameOver:
            UIRunning.Hide();
            UIPause.Hide();
            UIGameOver.Show();
            break;
        }
    }
Ejemplo n.º 2
0
 public void ShowPauseMenu()
 {
     SoundPlayer.main.PlaySound(GameSoundType.ShopOK);
     if (!PauseMenuCanBeOpened)
     {
         return;
     }
     canShowPopup = false;
     optionsButton.SetActive(false);
     Time.timeScale       = 0f;
     PauseMenuCanBeOpened = false;
     upgradeUI.HideToggle();
     fader.FadeIn(delegate {
         UIPauseMenu uiPauseMenu = Prefabs.Get <UIPauseMenu>();
         uiPauseMenu.Init(popupContainer, this);
         uiPauseMenu.Show("Options", "");
         currentPauseMenu = uiPauseMenu;
     });
 }