protected void PlayCutscene() { // Fade out and in to indicate time spent. AppearanceGameState.INSTANCE.InCutscene = true; _fader = new Fader(); // Fade to black StartCoroutine( _fader.FadeToBlack( 2, () => StartCoroutine(_fader.FadeInFromBlack(2, () => OnEndCutscene())) // Just fade back in afterwards ) ); }
private IEnumerator TrySwitch(Fader fader) { while (LevelLoader.Status == LoadStatus.Loading) yield return new WaitForEndOfFrame(); if (LevelLoader.Status == LoadStatus.Done) { LevelLoader.Switch(); var text = LevelText[_currentLevelIndex][Toolbox.Instance.gameState.DayCounter]; StartCoroutine(Camera.main.ShowCenterText(text, () => StartCoroutine(fader.FadeInFromBlack(3.0f, () => { })) )); } }