public override void Load()
        {
            m_WorldManager  = Session.GetManager <IWorldManager>();
            m_ChangeManager = Session.GetManager <IChangeManager>();
            m_ChangeManager.RegisterChangeCallback(HandleChanges, int.MinValue);

            m_Undo = Session.GetManager <IEditorUndoManager>();
            m_Undo.UndoRedoBatchStarted += HandleUndoRedoStarted;
            m_Undo.UndoRedoBatchEnded   += HandleUndoRedoEnded;
        }
Exemplo n.º 2
0
 public override void Load()
 {
     LoadUnityScratchPadScene();
     m_WorldManager  = Session.GetManager <IWorldManager>();
     m_EntityManager = m_WorldManager.EntityManager;
     m_SceneManager  = Session.GetManager <IEditorSceneManagerInternal>();
     m_ChangeManager = Session.GetManager <IChangeManager>();
     m_ChangeManager.RegisterChangeCallback(HandleChanges, int.MinValue);
     m_Undo = Session.GetManager <IEditorUndoManager>();
     m_Undo.UndoRedoBatchEnded += HandleUndoEnded;
     UnityEditor.SceneManagement.EditorSceneManager.sceneOpening += HandleUnitySceneOpening;
 }
Exemplo n.º 3
0
        void ISessionManagerInternal.Load()
        {
            AssetPostprocessorCallbacks.RegisterAssetImportedHandlerForType <SceneAsset>(HandleSceneImported);

            m_Persistence       = Session.GetManager <IPersistenceManager>();
            m_WorldManager      = Session.GetManager <IWorldManager>();
            m_EditorUndoManager = Session.GetManager <IEditorUndoManager>();
            Session.GetManager <IChangeManager>().BeginChangeTracking += HandleBeginChangeTracking;
            Session.GetManager <IChangeManager>().EndChangeTracking   += HandleEndChangeTracking;
            Session.GetManager <IChangeManager>().RegisterChangeCallback(HandleChanges);
            m_EditorUndoManager.UndoRedoBatchEnded += HandleUndo;
        }
Exemplo n.º 4
0
        public override void Load()
        {
            m_BindingsContext            = new BindingContext(Session);
            m_Undo                       = Session.GetManager <IEditorUndoManager>();
            m_Undo.UndoRedoBatchStarted += HandleUndoRedoBatchStarted;
            m_Undo.UndoRedoBatchEnded   += HandleUndoRedoBatchEnded;

            m_WorldManager     = Session.GetManager <IWorldManagerInternal>();
            m_ArchetypeManager = Session.GetManager <IArchetypeManager>();
            m_SceneManager     = Session.GetManager <IEditorSceneManagerInternal>();
            m_ComponentCache   = Session.GetManager <UnityComponentCacheManager>();
            Session.GetManager <IChangeManager>().RegisterChangeCallback(HandleChanges, int.MaxValue);
            UnityEditor.Undo.postprocessModifications += HandleInvertedChanges;
            EditorApplication.hierarchyChanged        += HandleHierarchyChanges;
            m_TransferMap = new NativeHashMap <EntityGuid, EntityGuid>(1024, Allocator.Persistent);
        }
Exemplo n.º 5
0
 internal static void SetUndoManager(DependencyObject obj, IEditorUndoManager undoManager)
 {
     obj.SetValue(EditorServices.undoManagerPropertyKey, undoManager);
 }