public void ResumeGame() { if (!_isPaused) { return; } Time.timeScale = _cachedTimeScale; _cachedCursorMode.Apply(); PauseInterface.FadeOut(() => { PauseInterface.gameObject.SetActive(false); ControlsMenu.Menu.SetClear(); OptionsMenu.Menu.SetClear(); PauseMenu.Menu.gameObject.SetActive(false); ControlsMenu.Menu.gameObject.SetActive(false); OptionsMenu.Menu.gameObject.SetActive(false); }); FadePostProcessingWeight(0f, PostProcessingFadeSpeed); _currentMenu = MainMenu.MenuObject.Empty; _isPaused = false; }
public virtual UnityAction BecomeControlledBy(Controller controller) { MyController = controller; // Delay control by a frame to avoid issues of input being handled twice StartCoroutine(DelayedActivateInput()); cursorSettings.Apply(); OnBecomeControlled.Invoke(); return(StopBeingControlled); }
private void Update() { bool isPressed = Keyboard.current.backquoteKey.isPressed; if (isPressed && !_wasPressed) { _menuOpen = !_menuOpen; if (_menuOpen) { _cachedCursorMode = Util.CursorMode.GetCurrent(); Util.CursorMode.Default.Apply(); } else { if (Util.CursorMode.GetCurrent() == Util.CursorMode.Default) { _cachedCursorMode.Apply(); } } } _wasPressed = isPressed; }