コード例 #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
ファイル: SceneMain.cs プロジェクト: swordlegend/actors.unity
        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;
            }
        }