- Home /
Assets with illegal characters in the name
I've joined a project part way through. We're having an issue getting a VCS set up because large numbers of materials have names like:
13_interior_beachgrove-3dview-bmcd2ar3\solid materials \flat colors\smooth\black
Is there any way to search through all assets(whether they are instantiated in the world or not) and rename them via a script? Doing it by hand would be extremely tedious.
Answer by Lucas Meijer 1 · May 10, 2010 at 08:30 PM
You can use System.IO.Directory, and System.IO.Path related methods in an editorscript to operate on your filesystem. It's best to do the actual move with AssetDatabase.MoveAsset() as that will preserve Unity's internal GUID, causing other assets that reference the moving asset to not have their references broken.
I'm assu$$anonymous$$g you mean in C#? How does one use those classes in Js?
@Zeroth: you use those classes in JS exactly the same way you do in C#.