示例#1
0
        internal static void SetDirty(string undoDescription = "")
        {
            bool canUndo = !string.IsNullOrEmpty(undoDescription);

            if (canUndo)
            {
                BTUndo.RegisterUndo(SharedTree, undoDescription);
            }
            SharedTree.GraphPosition = s_currentWindow._graph.CurrentPosition;
            SharedTree.Zoom          = s_currentWindow._graph.CurrentZoom;
            EditorUtility.SetDirty(SharedTree);
        }
示例#2
0
        private void InitializeWithAsset(BehaviourTree asset)
        {
            SharedTree   = asset;
            _lastAssetId = asset.GetInstanceID();

            InitializeGraph();
            if (!PlaymodeWatcher.IsPlaymode)
            {
                BTUndo.Initialize(SharedTree);
            }
            _hasTreeInitialized = true;
        }
示例#3
0
        private static void UndoRedoPreformed()
        {
            if (SharedTree == null)
            {
                return;
            }

            if (BTUndo.ApplyUndoRedo(SharedTree))
            {
                EditorUtility.SetDirty(SharedTree);
                s_currentWindow.InitializeWithAsset(SharedTree);
            }
        }