Esempio n. 1
0
    private void Update()
    {
        if (!IsGamePaused && InputsManager.AnyPauseButtonDown())
        {
            Time.timeScale = 0.0f;
            pauseTextGO.SetActive(true);
            IsGamePaused = true;
        }

        if (IsGamePaused)
        {
            if (InputsManager.AnyPauseButtonDown())
            {
                holdingStartTimer += Time.unscaledDeltaTime;
                if (holdingStartTimer >= HoldStartToGoBackTime)
                {
                    Time.timeScale = 1.0f;
                    SceneManager.LoadScene("Menus");
                }
            }
            else
            {
                holdingStartTimer = 0.0f;
                Time.timeScale    = 1.0f;
                pauseTextGO.SetActive(false);
                IsGamePaused = false;
            }
        }
    }