From 570e01de011073c2ee19ac62da935a4c250aa9fc Mon Sep 17 00:00:00 2001 From: Icarus <1375400884@qq.com> Date: Thu, 28 May 2020 19:04:59 +0800 Subject: [PATCH] !W OnRename --- Scripts/Editor/NodeEditor.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Scripts/Editor/NodeEditor.cs b/Scripts/Editor/NodeEditor.cs index 226f419..62b060b 100644 --- a/Scripts/Editor/NodeEditor.cs +++ b/Scripts/Editor/NodeEditor.cs @@ -57,7 +57,7 @@ namespace XNodeEditor { // serializedObject.Update(); must go at the start of an inspector gui, and // serializedObject.ApplyModifiedProperties(); goes at the end. serializedObject.Update(); - + #if ODIN_INSPECTOR InspectorUtilities.BeginDrawPropertyTree(objectTree, true); GUIHelper.PushLabelWidth(84); @@ -76,7 +76,7 @@ namespace XNodeEditor { NodeEditorGUILayout.PropertyField(iterator, true); portNames.Add(iterator.name); } - + //Deal with ports that are not drawn foreach (var port in target.Ports) { @@ -103,7 +103,7 @@ namespace XNodeEditor { serializedObject.ApplyModifiedProperties(); #if ODIN_INSPECTOR - // Call repaint so that the graph window elements respond properly to layout changes coming from Odin + // Call repaint so that the graph window elements respond properly to layout changes coming from Odin if (GUIHelper.RepaintRequested) { GUIHelper.ClearRepaintRequest(); window.Repaint(); @@ -144,7 +144,7 @@ namespace XNodeEditor { public virtual GUIStyle GetBodyHighlightStyle() { return NodeEditorResources.styles.nodeHighlight; } - + /// Add items for the context menu when right-clicking this node. Override to add custom menu items. public virtual void AddContextMenuItems(GenericMenu menu) { // Actions if only one node is selected @@ -173,6 +173,9 @@ namespace XNodeEditor { AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(target)); } + /// Called after this node's name has changed. + public virtual void OnRename() { } + [AttributeUsage(AttributeTargets.Class)] public class CustomNodeEditorAttribute : Attribute, XNodeEditor.Internal.NodeEditorBase.INodeEditorAttrib {