Exemple #1
0
        private IEnumerator LoadAndStartCurrentActivityProcedure()
        {
            StackedActivity currentActivity = GetCurrentActivity();

            foreach (string scene in currentActivity.GetScenes())
            {
                yield return(SceneManager.LoadSceneAsync(scene, LoadSceneMode.Additive));
            }

            menuStack.Clear();

            currentActivity.Initialize();
            currentActivity.Start();
        }
Exemple #2
0
        private IEnumerator UnloadAndStopCurrentActivityProcedure()
        {
            menuStack.Clear();

            StackedActivity currentActivity = GetCurrentActivity();

            currentActivity.Stop();
            foreach (string scene in currentActivity.GetScenes())
            {
                if (SceneManagerExtensions.IsSceneLoaded(scene))
                {
                    yield return(SceneManager.UnloadSceneAsync(scene));
                }
                else
                {
                    Debug.LogWarning("Problem while stopping current Activity : scene named \"" + scene + "\" is not loaded, but belongs to " +
                                     "the Activity being closed. You may have unloaded it manually somewhere.");
                }
            }
        }