Beispiel #1
0
        private IEnumerator UnloadContentScenes(ContentInfo contentInfo)
        {
            // unloading scenes that may have been preloaded
            List <Scene> scenesToUnload = new List <Scene>();

            for (int i = 0; i < SceneManager.sceneCount; i++)
            {
                Scene scene = SceneManager.GetSceneAt(i);
                if (scene.path.StartsWith(contentInfo.SubmodulePath))
                {
                    scenesToUnload.Add(scene);
                }
            }

            foreach (Scene scene in scenesToUnload)
            {
                SceneReference sceneReference = SceneMap.GetSceneReference(scene.path);
                if (!string.IsNullOrEmpty(sceneReference.Guid))
                {
                    yield return(SceneNavigator.Instance.UnloadScene(sceneReference, true));
                }
            }

            yield return(null);
        }
        public void RegisterSceneController(SceneController sceneController)
        {
            SceneReference sceneReference;

            sceneReference = SceneMap.GetSceneReference(SceneManager.GetActiveScene().path);

            RegisterSceneController(sceneController, sceneReference);
        }