Esempio n. 1
0
 private void Pause()
 {
     playerInput.playerControls.Basic.Disable();
     OnPauseGame?.Invoke();
     Time.timeScale = 0;
     this.SetMenu(1);
 }
Esempio n. 2
0
 /// <summary>
 /// Pause game event
 /// </summary>
 private void PauseGameEvent()
 {
     if (IsGameInProgress && !IsGamePaused)
     {
         IsGamePaused = true;
         OnPauseGame?.Invoke();
     }
 }
Esempio n. 3
0
    public virtual void PauseGame()
    {
        OnPauseGame?.Invoke();

        PauseNarration(true);
        DisableAllInput();
        SetUIPointer();

        Time.timeScale      = 0;
        AudioListener.pause = true;
    }
Esempio n. 4
0
 public void PauseGame()
 {
     Pause          = !Pause;
     Time.timeScale = Pause ? 0.001f : 1;
     EventManager.OnPauseGame(Pause);
     if (Pause)
     {
         OnPauseGame?.Invoke();
     }
     else
     {
         OnUnpauseGame?.Invoke();
     }
 }
Esempio n. 5
0
    public void SetGameIsPaused(bool value)
    {
        if (value == GameIsPaused)
        {
            return;
        }

        if (value)
        {
            OnPauseGame?.Invoke();
        }
        else
        {
            OnContinueGame?.Invoke();
        }
        GameIsPaused = value;
    }
Esempio n. 6
0
    private void Update()
    {
        if (_pausePanelOpen == false && _panelAnimating == true)
        {
            if (_pausePanelGroup.blocksRaycasts == false)
            {
                _pausePanelGroup.blocksRaycasts = true;
                OnPauseGame?.Invoke();
            }

            _pausePanelGroup.alpha += _fadeMultiplier * Time.unscaledDeltaTime;
            if (_pausePanelGroup.alpha >= 1f)
            {
                _pausePanelGroup.alpha        = 1f;
                _pausePanelGroup.interactable = true;
                _panelAnimating = false;
                _pausePanelOpen = true;
            }
        }
        else if (_pausePanelOpen == true && _panelAnimating == true)
        {
            if (_pausePanelGroup.interactable == true)
            {
                _pausePanelGroup.interactable = false;
            }
            _pausePanelGroup.alpha -= _fadeMultiplier * Time.unscaledDeltaTime;
            if (_pausePanelGroup.alpha <= 0f)
            {
                _pausePanelGroup.alpha          = 0f;
                _pausePanelGroup.blocksRaycasts = false;
                _panelAnimating = false;
                _pausePanelOpen = false;
                OnPauseGame?.Invoke();
            }
        }
    }
 public static void PauseGame()
 {
     OnPauseGame?.Invoke();
 }
 /**
  * Static trigger to execute game pause. Event can be fired globally.
  */
 public static void TriggerGamePause()
 {
     OnPauseGame?.Invoke();
 }
Esempio n. 9
0
 public void NotifyOnPauseGame(bool isPaused)
 {
     OnPauseGame?.Invoke(isPaused);
 }