private void Pause() { playerInput.playerControls.Basic.Disable(); OnPauseGame?.Invoke(); Time.timeScale = 0; this.SetMenu(1); }
/// <summary> /// Pause game event /// </summary> private void PauseGameEvent() { if (IsGameInProgress && !IsGamePaused) { IsGamePaused = true; OnPauseGame?.Invoke(); } }
public virtual void PauseGame() { OnPauseGame?.Invoke(); PauseNarration(true); DisableAllInput(); SetUIPointer(); Time.timeScale = 0; AudioListener.pause = true; }
public void PauseGame() { Pause = !Pause; Time.timeScale = Pause ? 0.001f : 1; EventManager.OnPauseGame(Pause); if (Pause) { OnPauseGame?.Invoke(); } else { OnUnpauseGame?.Invoke(); } }
public void SetGameIsPaused(bool value) { if (value == GameIsPaused) { return; } if (value) { OnPauseGame?.Invoke(); } else { OnContinueGame?.Invoke(); } GameIsPaused = value; }
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(); }
public void NotifyOnPauseGame(bool isPaused) { OnPauseGame?.Invoke(isPaused); }