I can't seem to build an AssetBundle targeting iOS to save my life. I open up build settings, select iOS, select "switch player", and build my AssetBundle. I then download that asset bundle on my iPhone, and I'm told that it doesn't have the correct version or target.
This is the script that I use to generate the AssetBundle:
[MenuItem("Assets/Build AssetBundle From Selection - Track dependencies")]
static void ExportResource()
{
// Bring up save panel
string path = EditorUtility.SaveFilePanel("Save Resource", "", "New Resource", "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.iPhone);
Selection.objects = selection;
}
}
As you can see I'm plainly targetting iPhone, and I've even tried increasing the version (as high as 50, which I've never come close to), but I'm still getting this message.
What do I need to do to build my AssetBundles for iOS?
↧