- Home /
Question by
J3-Gaming · Sep 01, 2011 at 09:21 PM ·
androidassetbundlebuildassetbundle
CharacterCustomization AssetBundles
I got everything to work, and I have a script so I can build the bundles for Android.
using UnityEditor;
using UnityEngine;
using System.Collections;
public class ExportResource : MonoBehaviour
{
[MenuItem("Signature Creative/Build AssetBundle From Selection")]
public static void ExportRes()
{
// Bring up save panel
string path = EditorUtility.SaveFilePanel("Save Resource", "", "Package", "unity3d");
if (path.Length != 0)
{
// Build the resource file from the active selection.
Object[] selection = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);
BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, BuildTarget.Android);
Selection.objects = selection;
}
}
}
The problem is: When Unity created the entire example for us, they did NOT use: BuildTarget.Android in the BuildAssetBundle method. How could I find their prefabs so I can rebuild the assets for the platforms I want?
Comment
Best Answer
Answer by Waz · Sep 02, 2011 at 12:55 PM
The CharacterCustomization demo has a script that does it - modify that script to your needs, don't pick the prefabs by hand.