diff --git a/Scripts/Editor/NodeEditor.cs b/Scripts/Editor/NodeEditor.cs index 19b71f3..76f4fe6 100644 --- a/Scripts/Editor/NodeEditor.cs +++ b/Scripts/Editor/NodeEditor.cs @@ -88,7 +88,7 @@ namespace XNodeEditor { public void Rename(string newName) { if (newName == null || newName.Trim() == "") newName = NodeEditorUtilities.NodeDefaultName(target.GetType()); target.name = newName; - AssetDatabase.RenameAsset(AssetDatabase.GetAssetPath(target), target.name); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(target)); } [AttributeUsage(AttributeTargets.Class)] diff --git a/Scripts/Editor/RenamePopup.cs b/Scripts/Editor/RenamePopup.cs index 1b4f718..5a80d59 100644 --- a/Scripts/Editor/RenamePopup.cs +++ b/Scripts/Editor/RenamePopup.cs @@ -49,16 +49,16 @@ namespace XNodeEditor { if (input == null || input.Trim() == "") { if (GUILayout.Button("Revert to default") || (e.isKey && e.keyCode == KeyCode.Return)) { target.name = NodeEditorUtilities.NodeDefaultName(target.GetType()); - AssetDatabase.RenameAsset(AssetDatabase.GetAssetPath(target), target.name); - Close(); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(target)); + Close(); } } // Rename asset to input text else { if (GUILayout.Button("Apply") || (e.isKey && e.keyCode == KeyCode.Return)) { target.name = input; - AssetDatabase.RenameAsset(AssetDatabase.GetAssetPath(target), target.name); - Close(); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(target)); + Close(); } } }