public void FadeOut() { if (ScreenFade) { ScreenFade.FadeScreenOut(); } }
public IEnumerator Unload(string name, bool useSceneFadeOut = true) { Scene scene = Array.Find(scenes, s => s.name == name); if (scene == null) { yield return(null); } if (useSceneFadeOut && scene.fadeOut) { screenFade.FadeScreenOut(); } while (useSceneFadeOut && scene.fadeOut && screenFade.screenIsActive) { yield return(new WaitForEndOfFrame()); } scene.Unload(); if (loadedScenes.Contains(name)) { loadedScenes.Remove(name); } if (activeScene == name) { if (loadedScenes.Count > 0) { activeScene = loadedScenes[loadedScenes.Count - 1]; } else { activeScene = ""; } } print("scene " + scene.name + " has been unloaded."); }
IEnumerator HideAllFadeOn() { allScreensHidden = false; screenFade.FadeScreenOut(); while (screenFade.screenIsActive) { yield return(new WaitForEndOfFrame()); } Array.ForEach(screens, s => s.Hide()); allScreensHidden = true; }