- Home /
Question by
tawheed · Nov 06, 2013 at 05:13 PM ·
assetbundle
how to build AssetBundle from Gameobject in hierarchy,,, not selection?
i am trying to automate the process of manual selection of game object from hierarchy then drag into the project panel by mouse then select Track dependencies from the menu and exporting the prefab into .Unity3D file
i want to automate this by code .
i think of the process like ... Create prefab then buildpipeline.BuildAssetBundle ,,,, but the first 2 parameters in buildpipeline.BuildAssetBundle are the Problem i can't make them fit with a gameobject nor prefab the first 1 takes (object ) as main asset and the second takes (object[]) which refer to the inside asset files ..... but i can't put this to refer to a gameobject nor prefab .
GameObject maw;
string paths="Assets";
public PrefabType dude;
void Start () {
dude=PrefabUtility.CreatePrefab("Assets\temp",maw);
// the problem is here the first 2 parameters ......
BuildPipeline.BuildAssetBundle((Object) dude, (Object[])dude, "Assets",
BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets , BuildTarget.Android);
}
Comment