public void OnPause(bool isPause) { if (isPause) { EventManager.TriggerEvent(new ControllerEvent(false)); EventManager.TriggerEvent(new BGMEvent(PlayType.PAUSE)); _PauseUI.SetActive(true); _TimeCounting.PauseTime(false); foreach (var scripts in RotateScripts) { scripts.enabled = false; } Time.timeScale = 0.001f; } else { EventManager.TriggerEvent(new ControllerEvent(true)); EventManager.TriggerEvent(new BGMEvent(PlayType.UNPAUSE)); _PauseUI.SetActive(false); _TimeCounting.PauseTime(true); foreach (var scripts in RotateScripts) { scripts.enabled = true; } Time.timeScale = 1f; } }
private void OnPause(bool isPause) { if (isPause) { EventManager.TriggerEvent(new ControllerEvent(false)); EventManager.TriggerEvent(new BGMEvent(PlayType.PAUSE)); _PauseUI.SetActive(true); _TimeCounting.PauseTime(false); Time.timeScale = 0.001f; } else { EventManager.TriggerEvent(new ControllerEvent(true)); EventManager.TriggerEvent(new BGMEvent(PlayType.UNPAUSE)); _PauseUI.SetActive(false); _TimeCounting.PauseTime(true); Time.timeScale = 1f; } }