public static void ReloadCurrentScene() { GameController.inputEnabled = false; GameController.loadingScene = true; ImageController.DesaturateScreen(v.desaturationLength); TimeScale.ChangeTimeScale(0, v.desaturationLength); Coroutine.DelayRealtime(v.desaturationLength + v.desaturationLength, () => { string currentSceneName = SceneManager.GetActiveScene().name; LoadScene(currentSceneName); }); }
private void Update() { if (inSlowMotion) { timeLeft -= Time.unscaledDeltaTime; } if (timeLeft <= 0 || Input.GetMouseButtonUp(1)) { TimeScale.ChangeTimeScale(defaultTimeScale, slowMotionTimeScaleChangeDuration); timeLeft = Mathf.Max(0.0f, timeLeft); inSlowMotion = false; } else if (!GameController.loadingScene && timeLeft >= slowMotionTimeScaleChangeDuration && Input.GetMouseButtonDown(1)) { TimeScale.ChangeTimeScale(slowMotionTimeScale, slowMotionTimeScaleChangeDuration); inSlowMotion = true; } }