- Home /
Can I write a script to rename objects as I create them?
I am trying to create a system of nested assets (with a script from the store). They come in with a prefix of GEOM, and I need to turn each one into a prefab immediately, and as such I want to change the prefix to SLAB. So is it possible to write an editor script that will automatically string replace GEOM whenever I create something, and just leave anything without GEOM alone?
Thanks
Answer by DaveA · Jul 18, 2012 at 12:48 AM
Look into using this: http://docs.unity3d.com/Documentation/ScriptReference/AssetPostprocessor.OnPostprocessModel.html
Thanks! Investigating more my question was probably poorly thought out. When the models import, they are fine. I don't want to change them then. Ins$$anonymous$$d I want to change them when I drag them from the project folder into the scene.
Actually while we are at it .. once it's renamed, if a prefab of the object can be placed in a specific folder, that would be fantastic :)