From 5ebf3b8805d1ccaabbc066704421fe61ff5f5e1a Mon Sep 17 00:00:00 2001 From: Simon Rodriguez Date: Fri, 15 Feb 2019 17:25:57 +0100 Subject: [PATCH] When the name is empty or just whitespaces, it reverts to the original node type name --- Scripts/Editor/NodeEditor.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Scripts/Editor/NodeEditor.cs b/Scripts/Editor/NodeEditor.cs index f38b510..44594f0 100644 --- a/Scripts/Editor/NodeEditor.cs +++ b/Scripts/Editor/NodeEditor.cs @@ -106,6 +106,7 @@ namespace XNodeEditor { } public void Rename(string newName) { + if (string.IsNullOrWhiteSpace(newName)) newName = UnityEditor.ObjectNames.NicifyVariableName(target.GetType().Name); target.name = newName; AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(target)); }