Пример #1
0
    void Update()
    {
        playTime += Time.deltaTime;

        if (Input.GetButtonDown("Pause"))
        {
            if (Input.GetAxisRaw("Pause") > 0)
            {
                switch (gameState)
                {
                case GameState.World:
                    pause = true;
                    //SceneManager.LoadScene("PauseMenu", LoadSceneMode.Additive);
                    pauseController.SetupMain();
                    gameState = GameState.Pause;
                    break;

                case GameState.Pause:
                    //pause = false;
                    //SceneManager.UnloadSceneAsync(SceneManager.GetSceneByName("PauseMenu"));
                    pauseController.ClosePauseMenu();
                    gameState = GameState.World;
                    break;

                case GameState.Battle:

                    break;

                case GameState.Cutscene:

                    break;
                }
            }
            else //if (Input.GetAxisRaw("Pause") < 0)
            {
                pauseController.ToggleCommand();
                Debug.Log("Opening command input...");
            }
        }
    }
Пример #2
0
 public void ClosePauseMenu()
 {
     pauseScript.ClosePauseMenu();
 }