Google.Android.AppBundle.Editor.AssetBundleBuilder

Provides helper methods for building AssetBundles with various texture compression formats.

Summary

Public static functions

BuildAssetBundles(string outputPath, AssetBundleBuild[] builds, AssetPackDeliveryMode deliveryMode, IEnumerable< MobileTextureSubtarget > additionalTextureFormats, BuildAssetBundleOptions assetBundleOptions)
Run one or more AssetBundle builds with the specified texture compression formats.
BuildAssetBundles(string outputPath, AssetBundleBuild[] builds, BuildAssetBundleOptions assetBundleOptions, MobileTextureSubtarget baseTextureFormat, IEnumerable< MobileTextureSubtarget > additionalTextureFormats)
Dictionary< string, Dictionary< TextureCompressionFormat, string > >
Run one or more AssetBundle builds with the specified texture compression formats.

Public static functions

BuildAssetBundles

AssetPackConfig BuildAssetBundles(
  string outputPath,
  AssetBundleBuild[] builds,
  AssetPackDeliveryMode deliveryMode,
  IEnumerable< MobileTextureSubtarget > additionalTextureFormats,
  BuildAssetBundleOptions assetBundleOptions
)

Run one or more AssetBundle builds with the specified texture compression formats.

Notes about the outputPath parameter:

  • If a relative path is provided, the file paths in the returned AssetPackConfig will be relative paths.
  • If an absolute path is provided, the file paths in the returned object will be absolute paths.
  • AssetBundle builds for additional texture formats will be created in siblings of this directory. For example, for outputDirectory "a/b/c" and texture format ASTC, there will be a directory "a/b/c#tcf_astc".
  • This directory and any sibling directories must be empty or not exist, otherwise an exception is thrown.

Details
Parameters
outputPath
The output directory for the ETC1 AssetBundles. See other notes above.
builds
The main argument to BuildPipeline.
deliveryMode
A delivery mode to apply to every asset pack in the generated config.
additionalTextureFormats
Texture formats to build for in addition to ETC1.
assetBundleOptions
Options to pass to BuildPipeline.
Returns
An AssetPackConfig containing file paths to all generated AssetBundles.

BuildAssetBundles

Dictionary< string, Dictionary< TextureCompressionFormat, string > > BuildAssetBundles(
  string outputPath,
  AssetBundleBuild[] builds,
  BuildAssetBundleOptions assetBundleOptions,
  MobileTextureSubtarget baseTextureFormat,
  IEnumerable< MobileTextureSubtarget > additionalTextureFormats
)

Run one or more AssetBundle builds with the specified texture compression formats.

This variant allows for overriding the base format and provides a different return type.

Details
Parameters
outputPath
The output directory for base AssetBundles. See the other method for notes.
builds
The main argument to BuildPipeline.
assetBundleOptions
Options to pass to BuildPipeline.
baseTextureFormat
The default format. Note: ETC1 is supported by all devices.
additionalTextureFormats
Texture formats to generate for in addition to the base.
Returns
A dictionary from AssetBundle name to TextureCompressionFormat to file outputPath.