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)); }