1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 01:06:01 +08:00

.Net 2.0 compatability

This commit is contained in:
Thor Brigsted 2019-02-17 12:24:58 +01:00
parent 8cb647734a
commit c306701853

View File

@ -106,7 +106,7 @@ namespace XNodeEditor {
}
public void Rename(string newName) {
if (string.IsNullOrWhiteSpace(newName)) newName = UnityEditor.ObjectNames.NicifyVariableName(target.GetType().Name);
if (newName == null || newName.Trim() == "") newName = UnityEditor.ObjectNames.NicifyVariableName(target.GetType().Name);
target.name = newName;
AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(target));
}