Exemplo n.º 1
0
 public void OnStageLoaded(StageBase stage)
 {
     cameraBaseList.Clear();
     Camera[] cameras = Camera.allCameras;
     for (int i = 0; i < cameras.Length; i++)
     {
         Camera camera = cameras[i];
         if (camera == mainCameraBase.camera || camera == uiCameraBase.camera)
         {
             continue;
         }
         CameraBase cameraBase =
             this.AddChild <CameraBase>(string.Format("{0}{1}", camera.name, i), camera, false);
         cameraBaseList.Add(cameraBase);
     }
 }
Exemplo n.º 2
0
        public IEnumerator IEGoto <T>(float fadeHideDuration = 0f, Action onStageShowCallback = null)
            where T : StageBase, new()
        {
            if (stage != null)
            {
                if (fadeHideDuration > 0)
                {
                    uiManager.FadeTo(0, 1, fadeHideDuration);

                    yield return(new WaitForSeconds(fadeHideDuration));
                }

                yield return(stage.IEPreDestroy());

                this.RemoveChild(stage.key);
                stage = null;
            }

            stage = this.AddChild <T>(null);
            stage.onShowCallback = onStageShowCallback;
            stage.Start();
        }