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); }
private void InitializeWithAsset(BehaviourTree asset) { SharedTree = asset; _lastAssetId = asset.GetInstanceID(); InitializeGraph(); if (!PlaymodeWatcher.IsPlaymode) { BTUndo.Initialize(SharedTree); } _hasTreeInitialized = true; }
private static void UndoRedoPreformed() { if (SharedTree == null) { return; } if (BTUndo.ApplyUndoRedo(SharedTree)) { EditorUtility.SetDirty(SharedTree); s_currentWindow.InitializeWithAsset(SharedTree); } }