예제 #1
0
 void OnEnable()
 {
     if (!LayerKernel.InstanceInternal || !LayerKernel.Initialized[SceneSub.GetLayerIndex(gameObject.scene.name)])
     {
         return;
     }
     HandleEnable();
 }
예제 #2
0
        protected virtual void Start()
        {
            if (!LayerKernel.InstanceInternal || !LayerKernel.Initialized[SceneSub.GetLayerIndex(gameObject.scene.name)])
            {
                return;
            }
            if (Layer != null)
            {
                return;
            }

            Layer = LayerKernel.Layers[SceneSub.GetLayerIndex(gameObject.scene.name)];
            Setup();
        }
예제 #3
0
        static void ChangeOp(string sceneName)
        {
            var nextScene = sceneName;

            LayerKernel.Initialized[SceneSub.GetLayerIndex(sceneName)] = false;
            Closed();
            Layer.ActiveLayer.Release();
            LayerKernel.LoadJobs.Add(SceneManager.UnloadSceneAsync(Layer.ActiveLayer.Scene));
            LayerKernel.LoadJobs.Add(Resources.UnloadUnusedAssets());
            LayerKernel.LoadJobs.Add(SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive));
            Layer.ActiveLayer = null;
            LayerKernel.RunUnscaled(CoChangeOP());

            IEnumerator CoChangeOP()
            {
                while (LayerKernel.LoadJobs.Count > 0)
                {
                    yield return(0);
                }
                NextActiveSceneName = nextScene;
            }
        }