public void Tick() { if (Input.GetKeyDown(_exitCode)) { _pauseController.HandlePauseMenuManagerDidPressMenuButton(); return; } if (Input.GetKeyDown(_restartCode)) { _pauseController.HandlePauseMenuManagerDidPressRestartButton(); return; } if (Input.GetKeyDown(_pauseToggleCode)) { if (_isPaused) { _pauseController.HandlePauseMenuManagerDidPressContinueButton(); } else { _pauseController.HandlePauseTriggered(); } return; } }
public static IEnumerator Pause() { yield return(new WaitForSeconds(0f)); PauseController pauseManager = Resources.FindObjectsOfTypeAll <PauseController>().First(); pauseManager.HandlePauseTriggered(); }