diff options
| author | yum <yum.food.vr@gmail.com> | 2026-01-06 16:51:03 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-01-06 16:51:06 -0800 |
| commit | 8dbc79a9ca68b38eeb5cc6dacc522ec0f854df0b (patch) | |
| tree | fec7a581c604bdcc82b1aa3cf6758b515d0dbaf7 /Scripts/Fold/Editor/FoldWindow.cs | |
| parent | 1d058ef6d306f6270f4316c5d7c8ce53a2f4e298 (diff) | |
Fold: add undo, fix shift+click
Diffstat (limited to 'Scripts/Fold/Editor/FoldWindow.cs')
| -rw-r--r-- | Scripts/Fold/Editor/FoldWindow.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Scripts/Fold/Editor/FoldWindow.cs b/Scripts/Fold/Editor/FoldWindow.cs index 44e373b..814225c 100644 --- a/Scripts/Fold/Editor/FoldWindow.cs +++ b/Scripts/Fold/Editor/FoldWindow.cs @@ -21,6 +21,7 @@ public class FoldWindow : EditorWindow { graphAsset = LoadOrCreateGraph(); ConstructGraphView(); + Undo.undoRedoPerformed += OnUndoRedo; } void OnDisable() @@ -28,10 +29,12 @@ public class FoldWindow : EditorWindow if (graphView != null) { rootVisualElement.Remove(graphView); + graphView.Dispose(); graphView = null; } AssetDatabase.SaveAssets(); + Undo.undoRedoPerformed -= OnUndoRedo; } FoldGraph LoadOrCreateGraph() @@ -60,6 +63,11 @@ public class FoldWindow : EditorWindow rootVisualElement.Add(graphView); } + void OnUndoRedo() + { + graphView?.Reload(); + } + public void ShowNotification(string message) { if (string.IsNullOrEmpty(message)) |
