summaryrefslogtreecommitdiffstats
path: root/Scripts/Fold/Editor/FoldWindow.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts/Fold/Editor/FoldWindow.cs')
-rw-r--r--Scripts/Fold/Editor/FoldWindow.cs8
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))