Пример #1
0
    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;
    }
Пример #2
0
 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);
 }
Пример #3
0
    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;
    }