コード例 #1
0
 public void FadeOut()
 {
     if (ScreenFade)
     {
         ScreenFade.FadeScreenOut();
     }
 }
コード例 #2
0
        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.");
        }
コード例 #3
0
        IEnumerator HideAllFadeOn()
        {
            allScreensHidden = false;

            screenFade.FadeScreenOut();

            while (screenFade.screenIsActive)
            {
                yield return(new WaitForEndOfFrame());
            }

            Array.ForEach(screens, s => s.Hide());

            allScreensHidden = true;
        }