1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 17:26:02 +08:00

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
This commit is contained in:
Simon Rodriguez 2019-05-13 20:53:34 +02:00 committed by Thor Brigsted
parent 8a03811ee3
commit 833e26ccc3

View File

@ -93,9 +93,9 @@ namespace XNodeEditor {
}
/// <summary> Safely remove a node and all its connections. </summary>
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();
}