x


Can you build a single assetbundle which can be used on multiple platforms?

I would like to do something like this:

BuildPipeline.BuildAssetBundle(mainAsset, assets, pathName, BuildAssetBundleOptions.CompleteAssets, BuildTarget.WebPlayer | BuildTarget.iPhone) 

But the last parameter (BuildTarget.WebPlayer | BuildTarget.iPhone) is giving me troubles when running the code, its all fine by the compiler btw. Unity basicly tells me you can't build assetbundles for iPhone when on Windows.

I thought assetbundles would be the same for all platforms. After all its Unity's own byte format.

more ▼

asked Apr 21 '11 at 01:13 PM

Lukas H gravatar image

Lukas H
99 2 2 5

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

http://docs.unity3d.com/Documentation/Manual/abfaq.html details which platforms asset bundles will run on. You need a different asset bundle for iOS, Android, and standalone (Win, Mac). Webplayer should work with standalone builds according to the grid (not personally tested).

I believe the reason is that the bundles get stripped down and optimised differently for iOS and Android to make sure they load as fast as possible. There may be other issues too, such as Endianness.

This link provides a useful summary about asset bundles: http://docs.unity3d.com/Documentation/Manual/AssetBundlesIntro.html

Annoyingly the FAQ above is not linked from that page, you have to go to here: http://docs.unity3d.com/Documentation/Manual/Advanced.html

more ▼

answered Aug 10 '12 at 04:41 PM

Robert Castle gravatar image

Robert Castle
121 5 5 8

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2001
x383
x261
x46

asked: Apr 21 '11 at 01:13 PM

Seen: 1267 times

Last Updated: Aug 10 '12 at 04:41 PM