Beispiel #1
0
 public override void OnQuit()
 {
     if (null != curScene)
     {
         curScene.Leave();
         curScene = null;
     }
 }
Beispiel #2
0
 public void SwitchScene <T>(T newScene, bool showLoading = true) where T : SceneBase
 {
     if (showLoading)
     {
         Global.Instance.BeginWaiting();
     }
     if (null != curScene)
     {
         curScene.Leave();
         curScene = null;
     }
     SceneLoader.Instance.AsnycLoadLevel(newScene.LevelName, (progress, isDone) =>
     {
         if (isDone)
         {
             curScene = newScene;
             curScene.Enter();
             StartCoroutine(WaitSceneReady());
         }
     });
 }