From 833e26ccc3247526d2c498a37c5659d53ebac386 Mon Sep 17 00:00:00 2001 From: Simon Rodriguez Date: Mon, 13 May 2019 20:53:34 +0200 Subject: [PATCH] Make RemoveNode + switch order * made RemoveNode function virtual used for example when a graph wants to block a delete * switched order of remove function and destroy function. target.RemoveNode was always getting a null value --- Scripts/Editor/NodeGraphEditor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Editor/NodeGraphEditor.cs b/Scripts/Editor/NodeGraphEditor.cs index 6fd00ea..c509d28 100644 --- a/Scripts/Editor/NodeGraphEditor.cs +++ b/Scripts/Editor/NodeGraphEditor.cs @@ -93,9 +93,9 @@ namespace XNodeEditor { } /// Safely remove a node and all its connections. - public void RemoveNode(XNode.Node node) { - UnityEngine.Object.DestroyImmediate(node, true); + public virtual void RemoveNode(XNode.Node node) { target.RemoveNode(node); + UnityEngine.Object.DestroyImmediate(node, true); if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets(); }