Working with Scenes and AssetBundles

In depth learning on Creating and Managing Asset Bundles is found in this course in Motive Academy.

Overview

As projects grow more complex, it’s important to have a consistent workflow for dealing with multiple scenes and AssetBundles. This page describes how to use Unity’s Additive Scene feature to streamline the AssetBundle workflow.

AssetBundle Prefabs in Additive Scenes

Most projects start with a single Scene and all objects and assets are configured inside of that Scene. As the project moves to using AssetBundles, keeping track of which assets are in the Scene and which are bundled becomes a chore. It is also a very common error for an app to be built with the assets built in, requiring another build and lost time.

A better approach is to put all assets that are intended to be bundled into another Scene that is loaded as an additive scene while you are editing it. Do this by right-clicking the Scene in Unity and choosing “Open Scene Additive”:

In this case, the Scene “Scenario 1 Assets” contains all of the assets we configured for that particular scenario.

To Load or Not Load?

While you are developing a scenario, you will often want to work with the local copy of your assets while you are iterating. This may conflict with any assets that are being spawned from AssetBundles. There are two approaches you can use to avoid this while developing:

  1. Disable the Spawn Asset Resource in Storyflow. This is a simple approach that will work, but could potentially impact any other users who are relying on the asset to spawn dynamically.

  2. Set the “Skip Asset Load” property on the World Configuration component. This setting has three options:

    1. Never: select this to always load any assets delivered via AssetBundle.

    2. Editor Only: select this to skip AssetBundle loads when you’re running in the editor.

    3. Always: always skip AssetBundle loads at runtime.

Related Articles

Spawn Asset Resource

Using Asset Bundles