mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
Renaming node to nothing (#112)
When the name is empty or just whitespaces, it reverts to the original node type name
This commit is contained in:
parent
f6404e9d9d
commit
662e919aaa
@ -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));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user