public void Load(int levelIndex, float fadeTime = 3.0f) { if (_loading) { return; } #if DEBUG Debug.Log("Loading level: " + _currentLevelIndex); #endif _currentLevelIndex = levelIndex; _loading = true; LevelLoader.Load(levelIndex); var fader = CameraUtil.GetFader(); StartCoroutine(fader.FadeToBlack(fadeTime, () => { StartCoroutine(TrySwitch(fader)); _loading = false; })); }
private void End() { StartCoroutine(CameraUtil.GetFader().FadeToBlack(10f, () => { Application.Quit(); })); }