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.