Note that the Buildtarget tagetplatform parameter is buildtarget.android
Using unityengine;using unityeditor;public class buildassetbundlesexample:monobehaviour{ [MenuItem ("example/ Build Asset Bundles ")] static void Buildabs () { //Put the Bundles in a folder called" ABs "within the Assets folder. Buildpipeline.buildassetbundles ("Assets/abs", Buildassetbundleoptions.none, buildtarget.android); }}
Buildtarget Compile target
Type: Enumeration
Target build platform.
Target compilation platform.
Note:this is an editor class. To use it, you should have a your script in Assets/editor inside your project folder. Editor classes is in the Unityeditor namespace so for C # scripts you need to add ' using Unityeditor; ' At the beginning of The script.
Note: This is an editor class and if you want to use it you need to put it under the Assets/editor folder in the project directory. The editor class is under the Unityeditor namespace. So when using C # scripts, you need to precede the script with a "using Unityeditor" reference.
See also: Buildpipeline.buildplayer.
Valuesvalue
- webplayerbuild a Web player.//compile a network player.
- Webplayerstreamedbuild a streamed web player.//compile a stream player.
- dashboardwidgetbuild an OS X Dashboard widget.
Compile an OS X Dashboard widget (Dashboard gadget).
- standaloneosxuniversalbuild an OS X standalone.//compile an OS X standalone version.
- Standaloneosxppcbuild an OS X standalone (PowerPC only).
Compile an OS X standalone version (PowerPC processor only).
- Standaloneosxintelbuild an OS X standalone (Intel only).
Compile an OS X standalone version (Intel processor only).
- standalonewindowsbuild a Windows standalone.//compile a Windows standalone version.
- Iphonebuild an iphone player//compile an iphone viewer.
- ps3build a PS3 Standalone//Compile a PS3 standalone version.
- xbox360build A Xbox Standalone//Compile an Xbox standalone version.
- Androidbuild an android apk standalone app
compiles an Android apk standalone app.
- wiibuild a Wii standalone//compile a Wii standalone version.
- standalonewindows64build a Windows 64-bit standalone.//Compile Windows standalone version 64-bit.
Unity Pack Android Platform Assetbundle script