function OnPostprocessModel (root : GameObject) : void
Description
Add this function in a subclass to get a notification when a model has completed importing
just before a prefab is generated out of the game object hierarchy
root is the root game object of the imported model.
class ColliderOnName
extends AssetPostprocessor {
function OnPostprocessModel (g :
GameObject) {
Apply(g.transform);
}
function Apply (transform :
Transform) {
if (transform.name.ToLower().Contains(
"collider"))
transform.gameObject.AddComponent(
MeshCollider);
for (
var child
in transform)
Apply(child);
}
}