From 8dbc79a9ca68b38eeb5cc6dacc522ec0f854df0b Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 6 Jan 2026 16:51:03 -0800 Subject: Fold: add undo, fix shift+click --- Scripts/Fold/Editor/FoldWindow.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Scripts/Fold/Editor/FoldWindow.cs') 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)) -- cgit v1.2.3