示例#1
0
 /// <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();
     }
 }
示例#2
0
 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--;
         }
     }
 }
示例#3
0
    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;
                }
            }
        }
示例#5
0
 /// <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)
     }
 }
示例#6
0
        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();
        }
示例#7
0
 /// <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();
 }
示例#8
0
 static void OnSceneLoaded(Scene scene, UnityEditor.SceneManagement.OpenSceneMode mode)
 {
     EditorUtil.DisableHasTransformed();
     MenuGUICacheData.Invalidate();
     Selection.activeObject = null;
 }
示例#9
0
 private void HandleSceneOpened(Scene scene, UnityEditor.SceneManagement.OpenSceneMode mode) => Dispose();
示例#10
0
 static void OnSceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEditor.SceneManagement.OpenSceneMode arg1)
 {
     //Debug.Log("Scene Loaded!");
     RefreshCurrentSceneDefinition();
 }