Beispiel #1
0
        /// <summary>
        /// Unloads the specified scene asynchronously
        /// </summary>
        /// <param name="sceneName"></param>
        public static void Unload(StratusSceneField scene, SceneCallback onSceneUnloaded = null)
        {
            // Editor mode
#if UNITY_EDITOR
            if (isEditMode)
            {
                EditorSceneManager.CloseScene(scene.runtime, true);
                return;
            }
#endif

            // Play Mode
            instance.StartCoroutine(instance.UnloadAsync(scene, onSceneUnloaded));
        }
Beispiel #2
0
        //----------------------------------------------------------------------------------/
        // Methods: Static
        //----------------------------------------------------------------------------------/
        /// <summary>
        /// Loads the scene specified by name.
        /// </summary>
        /// <param name="sceneName"></param>
        public static void Load(StratusSceneField scene, LoadSceneMode mode = LoadSceneMode.Additive, SceneCallback onSceneLoaded = null)
        {
            // Edit mode
#if UNITY_EDITOR
            if (isEditMode)
            {
                EditorSceneManager.OpenScene(scene.path, UnityEditor.SceneManagement.OpenSceneMode.Additive);
                return;
            }
#endif

            // Play mode
            instance.StartCoroutine(instance.LoadAsync(scene, mode, onSceneLoaded));
        }
Beispiel #3
0
 /// <summary>
 /// Reloads the specified scene
 /// </summary>
 public static void Reload(StratusSceneField scene, SceneCallback onFinished = null)
 {
     StratusScene.Load(StratusScene.activeScene, LoadSceneMode.Single);
 }