From a71cf4961dcf09181d73d2ec37436bb9c1f0c206 Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Sun, 24 Jun 2018 17:43:07 +0200 Subject: [PATCH] Small performance improvement. Nodes are now automatically marked dirty when changed. --- Scripts/Editor/NodeEditorGUI.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index 7230121..cda5b98 100644 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -364,12 +364,11 @@ namespace XNodeEditor { //Draw node contents nodeEditor.OnNodeGUI(); - //Apply - nodeEditor.serializedObject.ApplyModifiedProperties(); - //If user changed a value, notify other scripts through onUpdateNode if (EditorGUI.EndChangeCheck()) { if (NodeEditor.onUpdateNode != null) NodeEditor.onUpdateNode(node); + EditorUtility.SetDirty(node); + nodeEditor.serializedObject.ApplyModifiedProperties(); } GUILayout.EndVertical();