//----------------------------------------------------------------------------------/ // Methods: Static //----------------------------------------------------------------------------------/ /// <summary> /// Loads the scene specified by name. /// </summary> /// <param name="sceneName"></param> public static void Load(SceneField 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 get.StartCoroutine(get.LoadAsync(scene, mode, onSceneLoaded)); }
/// <summary> /// Unloads the specified scene asynchronously /// </summary> /// <param name="sceneName"></param> public static void Unload(SceneField scene, SceneCallback onSceneUnloaded = null) { // Editor mode #if UNITY_EDITOR if (isEditMode) { EditorSceneManager.CloseScene(scene.runtime, true); return; } #endif // Play Mode get.StartCoroutine(get.UnloadAsync(scene, onSceneUnloaded)); }
/// <summary> /// Reloads the specified scene /// </summary> public static void Reload(SceneField scene, SceneCallback onFinished = null) { Scene.Load(Scene.activeScene, LoadSceneMode.Single); }
//public override void OnInspectorGUI() //{ // base.OnInspectorGUI(); // if (link.scenePool == null) // return; // SelectScenes(); // // if (GUI.changed) // { // EditorUtility.SetDirty(link); // AssetDatabase.SaveAssets(); // } // //} private string GetName(SceneField sceneField) => sceneField.name;