- Home /
Changing the name of a project-asset in C#
I'm trying to build a renamimg/prefix/suffix-tool for organizing the project. I'm using Selection.gameObjects for the selecting part. While it works with everything in the herarchy in projectview, it only changes the internal names of prefabs. Is there a way of selecting and manipulating the name of everything in the projectview? (Selection.objects does not work too.)
Answer by GerryM · May 02, 2012 at 07:33 PM
Selection refers to objects in the scene/hierarchy. You might want to read up on the AssetDatabase class to work with your project files:
https://docs.unity3d.com/ScriptReference/AssetDatabase.html
You can rename assets with:
static function RenameAsset (pathName : String, newName : String) : String
Good luck!
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to change an object's name inside an asset file? 0 Answers
Make sure levels assets are loaded before switching? 1 Answer