- Home /
Create a Prefab from imported Assets automatically
Hi folks!
My goal is to reduce manual operations over imported assets. I've just see that it's possible by using AssetPostprocessor.
As first step I want to make a prefab of the imported object just after import and I tried with these few code lines:
class FBXtoPrefab extends AssetPostprocessor {
function OnPostprocessModel (g : GameObject) {
PrefabUtility.CreatePrefab("Assets/Prefabs/Tiles/" + g.name + ".prefab", g);
AssetDatabase.Refresh();
}
}
It seems to work, the prefab is created and it have all nodes and materials of the imported model but...the mesh filter is empty :(...
Tnx :)
Comment