Bundles

Building Bundles

The building process for asset bundles is managed by the BundleBuilder utility. It uses BundleConfig scriptable objects to define what assets are bundled. BundleBuilder supports building bundles for multiple platforms in a single pass.

Process Overview

  1. Create one or more BundleConfig scriptable objects.

  2. Set asset references to the BundleConfig

  3. Select the target platforms (e.g., Android, iOS, WebGL, Windows).

  4. Call BundleBuilder.BuildBundles() with the configs and platforms.

  5. Bundles are saved to the specified output path, organized by platform.

After building, a custom manifest JSON file is generated alongside each bundle, describing its contents and dependencies.

Code Example

var bundleConfigs = LoadAllBundleConfigs();
var platforms = new List<BundlePlatform> { BundlePlatform.Android, BundlePlatform.iOS };
BundleBuilder.BuildBundles(bundleConfigs, platforms, "Builds/Bundles");

Output Structure

The build process produces:

  • A directory per platform (e.g. Assets/Bundles/Android/)

  • Inside each platform directory:

    • The asset bundle files (e.g. bundleName)

    • Corresponding .json manifest files (e.g. bundleName.json)

    • The Unity-generated AssetBundleManifest file (e.g. bundleName.manifest)

Each asset bundle is built with correct dependency information. A custom JSON manifest is saved alongside each bundle for runtime use.

Texture Compression

All platforms ship ASTC textures only. Windows, Linux and Intel macOS GPUs cannot sample ASTC, in the Editor or in browsers, so Unity decodes each texture to RGBA32 on the CPU at load. That costs load time and about 16x the texture memory of ASTC 8x8 (a 2048² texture with mips takes 21.3 MB instead of 1.3 MB).

A BC7/DXT bundle set for desktop would avoid this, but it means ~2x larger texture downloads and twice the Web bundle builds. This limitation is known and accepted, so for now these desktops stay on ASTC.