/// <summary> /// onSceneOpened /// </summary> /// <param name="scene">scene</param> /// <param name="mode">OpenSceneMode</param> // ----------------------------------------------------------------------------------------- void onSceneOpened(Scene scene, UnityEditor.SceneManagement.OpenSceneMode mode) { if (mode == OpenSceneMode.Single) { this.Close(); } }
static void SceneOpenedCallback( Scene _scene, UnityEditor.SceneManagement.OpenSceneMode _mode) { if (isUndo) { index--; isUndo = false; } else if (isRedo) { index++; isRedo = false; ROM.write <Deque <string> >(ROM_SCENE, sceneDeck); } else { index++; int diff = sceneDeck.Count - index; if (diff > 0) { sceneDeck.RemoveRange(index, sceneDeck.Count - index); } sceneDeck.AddToBack(_scene.path); if (sceneDeck.Count > SCENE_COUNT) { sceneDeck.RemoveFromFront(); index--; } } }
public Session CreateSession(string scene_path, UnityEditor.SceneManagement.OpenSceneMode mode = OpenSceneMode.Single) { Session session = new Session(EditorSceneManager.OpenScene(scene_path, mode)); m_session_list.Add(session); return(session); }
static void SceneOpenedCallback(Scene _scene, UnityEditor.SceneManagement.OpenSceneMode _mode) { var allGO = _scene.GetRootGameObjects(); foreach (var go in allGO) { var iscene = go.GetComponent <IScene>(); if (iscene != null) { iscene.SceneLoaded(); break; } } }
/// <summary> /// When the scene opens we will clear and find all the imlComponents /// </summary> /// <param name="scene"></param> /// <param name="mode"></param> private static void SceneOpenedLogic(UnityEngine.SceneManagement.Scene scene, UnityEditor.SceneManagement.OpenSceneMode mode) { //Debug.Log("SceneOpened"); ClearIMLComponents(); FindIMLComponents(); // Reload all models (if we can) when we enter playmode or when we come back to the editor foreach (var MLComponent in m_IMLComponents) { // Get all nodes MLComponent.GetAllNodes(); // Reload models MLComponent.LoadAllModelsFromDisk(reCreateModels: true); // Run them (if marked with RunOnAwake) } }
private void Open(UnityEditor.SceneManagement.OpenSceneMode mode) { if (!SceneManager.GetSceneByName(Name).isLoaded) { Debug.LogFormat("Open Scene {0}", Name); EditorSceneManager.OpenScene(String.Format("{0}/{1}.unity", Path, Name), mode); } if (Config.PreProcess && Owner != null) { if (!SceneManager.GetSceneByName(StreamSceneName).isLoaded) { Debug.LogFormat("Open stream Scene {0}", StreamSceneName); EditorSceneManager.OpenScene(String.Format("{0}/{1}.unity", StreamPath, StreamSceneName), mode); } } UnityEngine.Resources.UnloadUnusedAssets(); }
/// <summary> /// When the scene opens we will clear and find all the imlComponents /// </summary> /// <param name="scene"></param> /// <param name="mode"></param> private static void SceneOpenedLogic(UnityEngine.SceneManagement.Scene scene, UnityEditor.SceneManagement.OpenSceneMode mode) { Debug.Log("SceneOpened"); ClearIMLComponents(); FindIMLComponents(); }
static void OnSceneLoaded(Scene scene, UnityEditor.SceneManagement.OpenSceneMode mode) { EditorUtil.DisableHasTransformed(); MenuGUICacheData.Invalidate(); Selection.activeObject = null; }
private void HandleSceneOpened(Scene scene, UnityEditor.SceneManagement.OpenSceneMode mode) => Dispose();
static void OnSceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEditor.SceneManagement.OpenSceneMode arg1) { //Debug.Log("Scene Loaded!"); RefreshCurrentSceneDefinition(); }