From 662e919aaabf205d825515ed976a093d5353b110 Mon Sep 17 00:00:00 2001 From: Simon Rodriguez Date: Sun, 17 Feb 2019 11:57:17 +0100 Subject: [PATCH] Renaming node to nothing (#112) 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)); }