How to use AssetDatabase.RenameAsset?
var path = AssetDatabase.GetAssetPath(target); //target is asset type of Scriptable Object var name = "My asset new name";
target.name = AssetDatabase.RenameAsset(path, name); AssetDatabase.SaveAssets();
As you could guess, code do not rename my asset. So, what is wrong?
Answer by ZeroComfort · May 05, 2019 at 08:50 AM
I'll answer this question for informational purposes, in case anyone finds this question.
AssetDatabase.RenameAsset() doesn't return the new name, it tries to rename the asset, and it will return an empty string if it was successful, or an error code if it wasn't.
Your answer
Follow this Question
Related Questions
how to open probuilder in unity? 1 Answer
How to load level after typing somthing? 1 Answer
I want to exactly put my player where i want it be. 0 Answers
Curl error 61 with UnityWebRequest 1 Answer