quot;AssetReference {reference.RuntimeKey} failed to load."); } } // Release asset when parent object is destroyed private void OnDestroy() { reference.ReleaseAsset(); } } ``` Refer to Loading an AssetReference for additional information about loading AssetReferences. ### Load by address You can use the address string to load an asset: ``` csharp using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; internal class LoadWithAddress : MonoBehaviour { // Assign in Editor or in code public string address; // Retain handle to release asset and operation private AsyncOperationHandle<GameObject> handle; // Start the load operation on start void Start() { handle = Addressables.LoadAssetAsync<GameObject>(address); handle.Completed += Handle_Completed; } // Instantiate the loaded prefab on complete private void Handle_Completed(AsyncOperationHandle<GameObject> operation) { if (operation.Status == AsyncOperationStatus.Succeeded) { Instantiate(operation.Result, transform); } else { Debug.LogError(quot;Asset for {address} failed to load."); } } // Release asset when parent object is destroyed private void OnDestroy() { handle.Release(); } } ``` Remember that every time you load an asset, you must also release it. Refer to Loading a single asset for more information. ### Load by label You can load sets of assets that have the same label in one operation: ``` csharp using System.Collections.Generic; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; internal class LoadWithLabels : MonoBehaviour { // Label strings to load public List<string> keys = new List<string>() {"characters", "animals"}; // Operation handle used to load and release assets AsyncOperationHandle<IList<GameObject>> loadHandle; // Load Addressables by Label void Start() { float x = 0, z = 0; loadHandle = Addressables.LoadAssetsAsync<GameObject>( keys, // Either a single key or a List of keys addressable => { //Gets called for every loaded asset if (addressable != null) { Instantiate<GameObject>(addressable, new Vector3(x++ * 2.0f, 0, z * 2.0f), Quaternion.identity, transform); if (x > 9) { x = 0; z++; } } }, Addressables.MergeMode.Union, // How to combine multiple labels false); // Whether to fail if any asset fails to load loadHandle.Completed += LoadHandle_Completed; } private void LoadHandle_Completed(AsyncOperationHandle<IList<GameObject>> operation) { if (operation.Status != AsyncOperationStatus.Succeeded) Debug.LogWarning("Some assets did not load."); } private void OnDestroy() { // Release all the loaded assets associated with loadHandle loadHandle.Release(); } } ``` See Loading multiple assets for more information. ## Manage Addressable assets To manage your Addressable assets, use the Addressables Groups window. Use this window to create Addressables groups, move assets between groups, and assign addresses and labels to assets. When you first install and set up the Addressables package, it creates a default group for Addressable assets. The Addressables system assigns any assets you mark as Addressable to this group by default. At the start of a project, you might find it acceptable to keep your assets in this single group, but as you add more content, you should create additional groups so that you have better control over which resources your application loads and keeps in memory at any given time. Key group settings include: * Build path: Where to save your content after a content build. * Load path: Where your application looks for built content at runtime. ##### Note ``` You can use Profile variables to set these paths. Refer to Profiles for more information. ``` * **Bundle mode**: How to package the content in the group into a bundle. You can choose the following options: * One bundle containing all group assets * A bundle for each entry in the group (useful if you mark entire folders as Addressable and want their contents built together) * A bundle for each unique combination of labels assigned to group assets * **Content update restriction**: Setting this value allows you to publish smaller content updates. Refer to Content update builds for more information. If you always publish full builds to update your app and don't download content from a remote source, you can ignore this setting. For more information on strategies to consider when deciding how to organize your assets, refer to Organizing Addressable assets. For more information on using the Addressables Groups window, refer to Groups. ## Build Addressable assets The Addressables content build step converts the assets in your Addressables groups into AssetBundles based on the group settings and the current platform set in the Unity Editor. You can configure the Addressables system to build your Addressables content as part of every Player build or you can build your content separately before making a Player build. Refer to Building Addressables content with Player builds for more information about configuring these options. If you configure Unity to build your content as part of the Player build, use the normal **Build** or **Build and Run** buttons in the Editor Build Settings window to start a build. Unity builds your Addressables content as a pre-build step before it builds the Player. In earlier versions of Unity, or if you configure Unity to build your content separately, you must make an Addressables build using the **Build** menu on the **Addressables Groups** window. The next time you build the Player for your project, it uses the artifacts produced by the last Addressables content build run for the current platform. To start a content build from the Addressables Groups window: 1. Open the Addressables Groups window (menu: **Windows > Asset Management > Addressables > Groups**). 2. Choose an option from the Build menu: * **New Build**: perform a build with a specific build script. Use the Default Build Script if you don't have your own custom one. * **Update a Previous Build**: builds an update based on an existing build. To update a previous build, the Addressables system needs the addressables_content_state.bin file produced by the earlier build. You can find this file in the Assets/AddressableAssetsData/Platform folder of your Unity Project. Refer to Content Updates for more information about updating content. * **Clean Build**: deletes cached build files. By default, the build creates files in the locations defined in your Profile settings for the **LocalBuildPath** and **RemoteBuildPath** variables. The files that Unity uses for your player builds include AssetBundles (.bundle), catalog JSON and hash files, and settings files. ##### Warning ``` Don't change the local build or load paths from their default values. If you do, you must copy the local build artifacts from your custom build location to the project's StreamingAssets folder before making a Player build. Altering these paths also precludes building your Addressables as part of the Player build. ``` If you have groups that you build to the **RemoteBuildPath**, you must upload those AssetBundles, catalog, and hash files to your hosting server. If your Project doesn't use remote content, set all groups to use the local build and load paths. A content build also creates the following files that Addressables doesn't use directly in a player build: * `addressables_content_state.bin`: used to make a content update build. If you support dynamic content updates, you must save this file after each content release. Otherwise, you can ignore this file. * `AddressablesBuildTEP.json`: logs build performance data. For more information, refer to Build Profiling. Refer to Building Addressable content for more information about how to set up and perform a content build. ### Start a full content build To make a full content build: 1. Set the desired Platform Target on the **Build Settings** window. 2. Open the **Addressables Groups** window (menu: **Asset Management** > **Addressables** > **Groups**). 3. Choose the **New Build** > **Default Build Script** command from the Build menu of the Groups window. The build process starts. After the build is complete, you can perform a player build and upload any remote files from your **RemoteBuildPath** to your hosting server. ##### Important ``` If you plan to publish remote content updates without rebuilding your application, you must preserve the addressables_content_state.bin file for each published build. Without this file, you can only create a full content build and player build, not an update. Refer to Content update builds for more information. ``` ## Remote content distribution You can use Addressables to support remote distribution of content through a Content Delivery Network (CDN) or other hosting service. Unity provides the Unity Cloud Content Delivery (CCD) service for this purpose, but you can use any CDN or host you prefer. Before building content for remote distribution, you must: * Enable the **Build Remote Catalog** option in your AddressableAssetSettings (access using menu: **Windows > Asset Management > Addressables > Settings**). * Configure the **RemoteLoadPath** in the Profile you use to publish content to reflect the remote URL at which you plan to access the content. * For each Addressables group containing assets you want to deliver remotely, set the **Build Path** to **RemoteBuildPath** and the **Load Path** to **RemoteLoadPath**. * Set desired **Platform Target** on the Unity **Build Settings** window. After you make a content build (using the Addressables Groups window) and a player build (using the **Build Settings** window), you must upload the files created in the folder designated by your profile's **RemoteBuildPath** to your hosting service. The files to upload include: * AssetBundles (name.bundle) * Catalog (catalog_timestamp.json) * Hash (catalog_timestamp.hash) Refer to Distributing remote content for more information. ## Incremental content updates When you distribute content remotely, you can reduce the amount of data your users need to download for an update by publishing incremental content update builds. An incremental update build allows you to publish remote bundles which contain only the assets that have changed since you last published an update rather than republishing everything. The assets in these smaller, updated bundles override the existing assets. ##### Important ``` You must enable the Build Remote Catalog option before you publish a player build if you want to have the option to publish incremental updates. Without a remote catalog, an installed application doesn't check for updates. ``` For more detailed information about content updates, including examples, refer to Content update builds. ### Start a content update build To make a content update, rather than a full build: 1. In the **Build Settings** window, set the **Platform Target** to match the target of the previous content build that you are now updating. 2. Open the **Addressables Groups** window (menu: **Asset Management > Addressables > Groups**). 3. From the **Tools** menu, run the **Check for Content Update Restrictions** command. The **Build Data File** browser window opens. 4. Locate the `addressables_content_state.bin` file produced by the previous build. This file is in a subfolder of `Assets/AddressableAssestsData` named for the target platform. 5. Select **Open**. The **Content Update Preview** window searches for changes and identifies assets that must be moved to a new group for the update. If you have not changed any assets in groups set to "Cannot Change Post Release," then no changes will be listed in the preview. (When you change an asset in a group set to "Can Change Post Release," then Addressables rebuilds all the AssetBundles for the group; Addressables does not move the changed assets to a new group in this case.) 6. Select **Apply Changes** to accept any changes. 7. From the **Build** menu, run the **Update a Previous Build** command. 8. Open the `addressables_content_state.bin` file produced by the previous build. The build process starts. After the build is complete, you can upload the files from your **RemoteBuildPath** to your hosting server. ##### Important ``` Addressables uses the addressables_content_state.bin file to identify which assets you changed. You must preserve a copy of this file for each published build. Without the file, you can only create a full content build, not an update. ``` ## Addressables samples The Addressables package contains samples that you can download into your project. To access the samples go to **Window** > **Package Manager** > **Addressables**. These samples include examples on how to disable asset importing during a build, creating custom build and Play mode scripts, and providing an `AddressableUtility` class. When you download and import a sample, it's placed inside the `Assets/Samples/Addressables/{AddressablesVersionNumber}` path of your project. #### **Addressables Utility** Contains a set of utility functions for Addressables. The script contains a static method `GetAddressFromAssetReference` which provides the Addressable address used to reference a given `AssetRefence` internally. #### **ComponentReference** Creates an AssetReference that's restricted to having a specific component. For more information see the ComponentReference sample project located in the **Addressables Samples** repository. #### **Custom Build and Playmode Scripts** Includes two **custom scripts**: - A custom Play mode script located in `Editor/CustomPlayModeScript.cs` of the sample. This script works similarly to the Use Existing Build (requires built groups) play mode script already included. The methods added to accomplish this are `CreateCurrentSceneOnlyBuildSetup` and `RevertCurrentSceneSetup` on the `CustomBuildScript`. - A custom build script located in `Editor/CustomBuildScript.cs` of the sample. This custom build script creates a build that only includes the currently open scene. A bootstrap scene is automatically created and a script is added that loads the built scene on startup. For these examples, the build and load paths used by default are `[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]` and `{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]` respectively. The `ScriptableObject` of the class has already been created, but you can use the Create menu to make another `ScriptableObject`. For this `CustomPlayModeScript` the create menu path is **Addressables > Content Builders > Use CustomPlayMode Script**. By default, this creates a CustomPlayMode.asset ScriptableObject. The same goes for the `CustomBuildScript`. #### **Disable Asset Import on Build** Provides a script that disables asset importing during a player build. This improves build performance because `AssetBundles` are copied into StreamingAssets at build time. This sample is only relevant for Editor versions below 2021.2. In 2021.2+, the Editor provides the ability to include folders outside of `Assets/` into `StreamingAssets`. When the sample is imported into the project, a player build without asset importing can be triggered by the new menu item **Build/Disabled Importer Build**. The build output is placed into `DisabledImporterBuildPath/{EditorUserBuildSettings.activeBuildTarget}/` by default. The sample class `DisableAssetImportOnBuild` can be edited to alter the build path. #### **Import Existing Group** Contains a tool that imports group assets, for example from a custom package, to the current project. The tool is located under `Window/Asset Management/Addressables/Import Groups`. The window requires a path to the `AddressableAssetGroup.asset` scriptable object, a name for the group, and a folder for any schemas related to the imported `AddressableAssetGroup`. #### **Prefab Spawner** Provides a basic script that instantiates and destroys a prefab `AssetReference`. To use the sample, attach the provided script, `PrefabSpawnerSample`, to a `GameObject` in your scene. Assign an `AdressableAsset` to the `AssetReference` field of that script. If you're using the `Use Existing Build` playmode script, ensure that your Addressable content is built. Then, enter Play mode. #### **Custom Analyze Rules** This sample shows how to create custom AnalyzeRules for use within the Analyze window. Both rules follow the recommended pattern for adding themselves to the UI. # Manage Addressables The main way to organize and manage addressables is to use groups and profiles. This section outlines how to use these to effectively manage addressables. | **Topic** | **Description** | | ------------------------------------- | --------------------------------------------------------------------------------- | | Manage Addressables introduction | Understand the different ways to manage addressables in your project. | | Organize Addressable assets | Understand the different approaches to organize addressable assets. | | Groups overview | Use groups to organize the different assets in your project. | | Profiles overview | Use profiles to manage how to build addressable assets. | | Asset references overview | Use asset references to customize `MonoBehaviour` and `ScriptableObject` scripts. | | Addressables Asset Settings reference | Reference information for Addressable Asset Settings | | Addressables Preferences reference | Reference information for the Addressables Preferences window. | ## Manage Addressables introduction Before you decide how you want to manage the assets in your project, refer to How Addressables interacts with your project assets. Addressable groups are the main unit of organization that you use to manage Addressable assets. An important consideration are your options for packing groups into AssetBundles. Alongside group settings, you can use the following to control how Addressables work in a project: * Addressable asset settings: The project-level settings of Addressable assets. * Profiles: Defines collections of build path settings that you can switch between depending on the purpose of a build. Primarily of interest if you plan to distribute content remotely. * Labels: Edit the Addressable asset labels used in your project. * Play mode scripts: Choose how the Addressables system loads assets when you enter Play mode in the Editor. AssetReferences offer a UI-friendly way to use Addressable assets. You can include AssetReference fields in MonoBehaviour and ScriptableObject classes and then assign assets to them in the Unity Editor using drag-and-drop or the object picker dialog. The Addressables system provides the following additional tools to help development: * Build layout report: provides a description of the AssetBundles produced by a build. * Build profile log: provides a log profiling the build process itself so that you can see which parts take the longest. ### Further resources Organize Addressable assets ## Organize Addressable assets The best way to organize your assets depends on the specific requirements of each project. Aspects to consider when planning how to manage your assets in a project include: - **Logical organization**: Keep assets in logical categories to make it easier to understand your organization and discover items that are out of place. - **Runtime performance**: Performance bottlenecks can happen if your AssetBundles grow in size, or if you have many AssetBundles. - **Runtime memory management**: Keep assets together that you use together to help lower peak memory requirements. - **Scale**: Some ways of organizing assets might work well in small games, but not large ones, and vice versa. - **Platform characteristics**: The characteristics and requirements of a platform can be a large consideration in how to organize your assets. Some examples: - Platforms that offer abundant virtual memory can handle large bundle sizes better than those with limited virtual memory. - Some platforms don't support downloading content, ruling out remote distribution of assets entirely. - Some platforms don't support AssetBundle caching, so putting assets in local bundles, when possible, is more efficient. - **Distribution**: Whether you distribute your content remotely or not means that you must separate your remote content from your local content. - **How often assets are updated**: Keep assets that you expect to update often separate from those that you plan to rarely update. - - **Version control**: The more people who work on the same assets and asset groups, the greater the chance for version control conflicts to happen in a project. ### Common strategies Typical strategies for organizing assets include: - **Concurrent usage**: Group assets that you load at the same time together, such as all the assets for a given level. This strategy is often the most effective in the long term and can help reduce peak memory use in a project. - **Logical entity**: Group assets belonging to the same logical entity together. For example, UI layout assets, textures, sound effects. Or character models and animations. - **Type**: Group assets of the same type together. For example, music files, textures. Depending on the needs of your project, one of these strategies might make more sense than the others. For example, in a game with many levels, organizing according to concurrent usage might be the most efficient both from a project management and from a runtime memory performance standpoint. At the same time, you might use different strategies for different types of assets. For example, your UI assets for menu screens might all be grouped together in a level-based game that otherwise groups its level data separately. You might also pack a group that has the assets for a level into bundles that contain a particular asset type. Refer to Preparing Assets for AssetBundles for additional information. ## Safely edit loaded assets You can safely edit loaded Assets in the following situations: * The Asset is loaded from an AssetBundle. * The application is running in a Player, not in the Editor. * When you enable the Use Existing Build (requires built groups) option in Play Mode Scripts. In these cases, the assets exist as a copy in active memory. Changes made to these copied assets don't affect the saved AssetBundle on disk and any changes don't persist between sessions. For other situations, including when you enable the Use Asset Database (fastest) property in the Play mode settings, Unity loads the Assets directly from the Project files. This means that Unity saves any modifications to the Asset during runtime to the Project Asset file and that those changes will persist between different sessions. If you want to make runtime changes to an asset, create a new instance of the GameObject you want to change and use the copy for any runtime changes. This eliminates the risk that you might accidentally change the original asset file. The following code example demonstrates creating a new copy of a loaded asset: ``` csharp var op = Addressables.LoadAssetAsync<GameObject>("myKey"); yield return op; if (op.Result != null) { GameObject inst = UnityEngine.Object.Instantiate(op.Result); // can now use and safely make edits to inst, without the source Project Asset being changed. } ``` If you use this example method to use a copy of an asset, be aware of the following: * You must use either the original asset or the AsyncOperationHandle when you release the asset, not the current instance of the asset. * When you instantiate an asset that has references to other assets in this way, Unity doesn't create new instances of the referenced assets. The references for the newly instantiated copy target the original project asset. * Unity invokes MonoBehaviour methods like Start(), OnEnable(), and OnDisable() on the new instance. ## Groups overview A group is the main organizational unit of the Addressables system. Create and manage your groups and the assets they contain with the Addressables Groups window. | Topic | Description | | ------------------------------------ | ----------------------------------------------------------- | | Groups introduction | Understand groups and how to work with them. | | Manage and create groups | Create profiles in the Unity Editor. | | Labels overview | Understand and work with labels. | | Create a group template | Create group templates. | | Pack groups into AssetBundles | Understand how you can put groups into AssetBundles. | | Addressables Groups window reference | Reference information for the Addressables Groups window. | | Group settings and schemas overview | Reference information for group settings and their schemas. | ### Groups introduction A group is the main organizational unit of the Addressables system. Create and manage your groups and the assets they contain with the Addressables Groups window. To control how Unity handles assets during a content build, organize Addressables into groups and assign different settings to each group as required. Refer to Organizing Addressable Assets for information about how to organize your assets. When you begin a content build, the build scripts create AssetBundles that contain the assets in a group. The build determines the number of bundles to create and where to create them from both the settings of the group and your overall Addressables system settings. Refer to Builds for more information. ##### Note ``` Addressable Groups only exist in the Unity Editor. The Addressables runtime code doesn't use a group concept. However, you can assign a label to the assets in a group if you want to find and load all the assets that were part of that group. Refer to Loading Addressable assets for more information about selecting the assets to load using labels. ``` ### Manage and create groups To manage your groups and Addressables assets, open the Addressables Groups window by going to **Window >Asset Management > Addressables > Groups**. Refer to Addressables Groups window for details about the features of this window. #### Create a group To create a group: 1. Go to **Window > Asset Management > Addressables** and select **Groups** to open the Addressables Groups window. 2. Select **New > Packed Asset** to create a new group. If you've created your own group templates, they are also displayed in the menu. 3. Context click the new group and select **Rename** to rename the group. 4. Open the context menu again and select **Inspect Group Settings**. 5. Adjust the group settings as desired. For groups that contain assets that you plan to distribute with your main application, the default settings are a reasonable starting point. For groups containing assets that you plan to distribute remotely, you must change the build and load paths to use the remote versions of the Profile path variables. To build AssetBundles for remote distribution, you must also enable the **Build Remote Catalog** option in the Addressable System Settings. Refer to Group settings for more information about individual settings. #### Add assets to a group Use one of the following methods to add an asset to a group: * Drag the assets from the Project window into the Group window and drop them into the desired group. * Drag the assets from one group into another. * Select the asset to open it in the Inspector window and enable the **Addressables** option. This adds the asset to the default group. Use the group context menu to change which group is the default group. * Add the folder containing the assets to a group. All assets added to the folder are included in the group. ##### Note ``` If you add assets in a Resources folder to a group, the Addressables system first moves the assets to a non-Resource location. You can move the assets elsewhere, but you can't store Addressable assets in a Resources folder in your project. ``` #### Remove assets from a group Select one or more assets in the Groups window and right-click to open the context menu, then select **Remove Addressables**. You can also select the assets and press the Delete key to remove the assets from the group. #### Add or remove labels Select one or more assets in the Groups window, then select the label field for one of the selected assets. To assign labels, enable or disable the checkboxes for the desired labels. To add, remove or rename your labels, select the + button, then select **Manage Labels**. To only add a new label, select the + button and then select **New Label**. Refer to Labels for more information on how to use labels. ### Labels overview You can tag your Addressable assets with one or more labels in the Addressables Groups window. Labels have a few uses in the Addressables system, including: * You can use one or more labels as keys to identify which assets to load at runtime. * You can pack assets in a group into AssetBundles based on their assigned labels. * You can use labels in the filter box of the Groups window to help find labeled assets When you load assets using a list of labels, you can specify whether you want to load all assets that have any label in the list or only assets that have every label in the list. For example, if you used the labels, `characters` and `animals` to load assets, you could choose to load the union of those two sets of assets, which includes all characters and all animals, or the intersection of those two sets, which includes only characters that are animals. Refer to Loading multiple assets for more information. When you choose to pack assets in a group based on their assigned labels using the group Bundle Mode setting, the Addressables build script creates a bundle for each unique combination of labels in the group. For example, if you have assets in a group that you have labeled as either cat or dog and either small or `large`, the build produces four bundles: one for small cats, one for small dogs, one for large cats, and another for large dogs. #### Managing labels To create and delete labels, use the Labels window, which is accessible from the Addressables Groups window (**Window > Asset Management > Addressables > Groups > Tools > Windows > Labels**). The Labels window displays a configurable list of labels. The Labels window. To create a new label, select the + button at the bottom of the list. Enter the new name and click **Save**. To delete a label, select it in the list and then select the - button. Deleting a label also removes it from all assets. ##### Tip ``` Until you run an Addressables build, you can undo the deletion of a label by adding it back to the Labels dialog (using the exact same string). This also adds the label back to its original assets. After you run an Addressables build, however, re-adding a deleted label no longer reapplies it to any assets. ``` ### Create a group template A group template defines which types of schema objects Unity creates for a new group. The Addressables system includes the Packed Assets template, which includes all the settings needed to build and load Addressables using the default build scripts. If you want to create your own build scripts or utilities that need additional settings, you can define these settings in your own schema objects and create your own group templates. The following instructions describe how to do this: 1. Navigate to the desired location in your Assets folder using the Project panel. 2. Create a Blank Group Template (menu: Assets > Addressables > Group Templates > Blank Group Templates). 3. Assign a name to the template. 4. In the Inspector window, add a description, if desired. 5. Click the Add Schema button and choose from the list of schemas. Repeat these steps to add as many new schemas as needed. ##### Note ``` If you use the default build script, a group must use the Content Packing & Loading schema. If you use content update builds, a group must include the Content Update Restrictions schema. Refer to Builds for more information. ``` ### Pack groups into AssetBundles You have a few options when choosing how the assets in a group are packed into AssetBundles: * You can pack all Addressables assigned to a group together in a single bundle. This corresponds to the Pack Together bundle mode. * You can pack each Addressable assigned to a group separately in its own bundle. This corresponds to the Pack Separately bundle mode. * You can pack all Addressables sharing the same set of labels into their own bundles. This corresponds to the Pack Together By Label bundle mode. For more information on bundle modes, refer to Advanced Group Settings. Scene assets are always packed separately from other Addressable assets in the group. Therefore, a group containing a mix of scene and non-scene assets always produces at least two bundles when built: one for scenes and one for everything else. Assets in folders that are marked as Addressable and compound assets like sprite sheets are treated specially when you choose to pack each Addressable separately: * All the assets in a folder that are marked as Addressable are packed together in the same folder (except for assets in the folder that are individually marked as Addressable themselves). * Sprites in an Addressable Sprite Atlas are included in the same bundle. See Content Packing & Loading settings for more information. ##### Note ``` Keeping many assets in the same group can increase the chance of version control conflicts when many people work on the same project. ``` #### AssetBundle packing strategy The choice whether to pack your content into a few large bundles or into many smaller bundles, can have consequences at either extreme: Dangers of too many bundles: * Each bundle has memory overhead. If you anticipate hundreds or even thousands of bundles loaded in memory at once, this could mean a noticeable amount of memory used. * There are concurrency limits for downloading bundles. If you have thousands of bundles you need all at once, they can't all be downloaded at the same time. Some number will be downloaded, and as they finish, more will trigger. In practice this is a fairly minor concern, so minor that you'll often be gated by the total size of your download, rather than how many bundles it's broken into. * Bundle information can bloat the catalog. To be able to download or load catalogs, Unity stores string-based information about your bundles. Thousands of bundles worth of data can greatly increase the size of the catalog. * Greater likelihood of duplicated assets. For example, if you have two materials are marked as Addressable and each depend on the same texture. If they are in the same bundle, then the texture is pulled in once, and referenced by both. If they are in separate bundles, and the texture is not itself Addressable, then it will be duplicated. You then either need to mark the texture as Addressable, accept the duplication, or put the materials in the same bundle. See Asset and AssetBundle dependencies for more information. Dangers of too few bundles: * The UnityWebRequest (which Unity uses to download) does not resume failed downloads. So if a large bundle is downloading and your user loses connection, the download is started over once they regain connection. * Items can be loaded individually from bundles, but cannot be unloaded individually. For example, if you have 10 materials in a bundle, load all 10, then tell Addressables to release 9 of them, all 10 will likely be in memory. See Memory management for more information. #### Scale implications as your project grows larger As your project grows larger, be aware of the following aspects of your assets and bundles: * Total bundle size: Historically Unity has not supported files larger than 4GB. This has been fixed in some recent editor versions, but there can still be issues. You should keep the content of a given bundle under this limit for best compatibility across all platforms. * Bundle layout at scale: The memory and performance trade-offs between the number of AssetBundles produced by your content build and the size of those bundles can change as your project grows larger. * Bundle dependencies: When an Addressable asset is loaded, all of its bundle dependencies are also loaded. Be aware of any references between assets when creating Addressable groups. Refer to Asset and AssetBundle dependencies for more information. * Sub assets affecting UI performance: There is no hard limit here, but if you have many assets, and those assets have many subassets, it might be best to disable sub-asset display. This option only affects how the data is displayed in the Groups window, and does not affect what you can and cannot load at runtime. The option is available in the groups window under Tools> Show Sprite and Subobject Addresses. Disabling this will make the UI more responsive. * Group hierarchy display: Another UI-only option to help with scale is Group Hierarchy with Dashes. This is available within the inspector of the top level settings. With this enabled, groups that contain dashes - in their names will display as if the dashes represented folder hierarchy. This does not affect the actual group name, or the way things are built. For example, two groups called x-y-z and x-y-w would display as if inside a folder called x, there was a folder called y. Inside that folder were two groups, called x-y-z and x-y-w. This doesn't affect UI responsiveness, but simply makes it easier to browse a large collection of groups. ### Addressables Groups window reference Use the Addressables Groups window to manage your groups and Addressable assets. To open the window, go to Window > Asset Management > Addressables > Groups. The Groups window also serves as a central location for starting content builds and accessing the tools and settings of the Addressables system. A group is the main organizational unit of the Addressables system. Use this window to create and manage your groups and the assets they contain. The Addressables Groups window showing the toolbar and list of groups and assets. The Addressables Groups window showing the toolbar and list of groups and assets. #### Group list The Group list displays the Addressable groups in your Project. Expand a group in the list to display the assets that it contains. You can also expand composite assets, such as sprite sheets, to display the sub-objects they contain. When you first install the Addressables package, the Groups window displays two groups of assets: * Default Local Group (Default): Initially empty, Unity adds any assets you make Addressable to this group. The group is set up so that its assets are built to your local build path and included in your Project builds. You can change the name, settings, and make another group the default group, if desired. The settings of the default group are also used to create shared AssetBundles. The list columns contain the following information: | **Column** | **Description** | | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Notifications** | Any notifications about a Group, or asset, that's flagged during the build. | | **Group Name \ Addressable Name** | The name of the item. For groups, this is an arbitrary name that you can assign. For assets, this is the Addressable address. You can edit the name or address using the context menu. | | **Icon** | The Unity asset icon based on asset type. | | **Path** | The path to the source asset in your project. | | **Labels** | Displays any labels assigned to the asset. Click on a label entry to change the assigned labels or to manage your label definitions. | To sort the assets displayed in the group list, select one of the column headers. This sorts the assets within each group, but doesn't reorder the groups. To change the order that the groups are displayed, drag them into the desired position. #### Groups window toolbar The toolbar at the top of the Addressables Group window provides the following settings: | **Setting** | **Description** | | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **New** | Choose a template to create a new group, or blank for no schema. Refer to [Group templates](https://docs.unity3d.com/Packages/com.unity.addressables@2.7/manual/GroupTemplates.html) for information about creating your own templates. | | **Profile** | Set the active Profile to select the paths used for building and loading Addressables. Choose an existing profile or select **Manage Profiles** to open the [Profiles window](https://docs.unity3d.com/Packages/com.unity.addressables@2.7/manual/AddressableAssetsProfiles.html). | | **Tools** | Open the various Addressables tools available. Choose from: <br> <br>- **Inspect System Settings**: Open the [Addressables Settings](https://docs.unity3d.com/Packages/com.unity.addressables@2.7/manual/AddressableAssetSettings.html) Inspector. <br>- **Check for Content Update Restrictions**: Run a pre-update content check. Refer to [Update Restrictions](https://docs.unity3d.com/Packages/com.unity.addressables@2.7/manual/ContentUpdateWorkflow.html) for more information. <br>- **Window**: Open other Addressables system windows: [Profiles](https://docs.unity3d.com/Packages/com.unity.addressables@2.7/manual/AddressableAssetsProfiles.html), [Labels](https://docs.unity3d.com/Packages/com.unity.addressables@2.7/manual/Labels.html), or the [Addressables Report](https://docs.unity3d.com/Packages/com.unity.addressables@2.7/manual/AddressablesReportOverview.md) window. <br>- **Groups View**: Set Group window display options: <br>- **Show Sprite and Subobject Addresses**: Enable to display sprite and sub-objects in the Group list or just the parent object <br>- **Group Hierarchy with Dashes**: Enable to display groups that contain dashes `-` in their names as if the dashes represented a group hierarchy. For example, if you name two groups `x-y-z` and `x-y-w`, the window displays an entry called `x` with a child called `y`, which contains two groups, called `x-y-z` and `x-y-w`. Enabling this option affects the group display only. | | **Play Mode Script** | Set the active Play Mode Script. The active Play Mode Script determines how Addressables are loaded in the Editor Play mode. Refer to [Play Mode Scripts](https://docs.unity3d.com/Packages/com.unity.addressables@2.7/manual/GroupsWindow.html#play-mode-scripts) for more information. | | **Build** | Select a content build command: <br> <br>- **New Build**: Choose a build script to run a full content build. <br>- **Update a Previous Build**: Run a differential update based on an earlier build. <br>- **Clear Build Cache**: choose a command to clean existing build artifacts. <br> <br>Refer to [Builds](https://docs.unity3d.com/Packages/com.unity.addressables@2.7/manual/Builds.html) for more information. | #### Play Mode Scripts The active Play Mode Script determines how the Addressable system accesses Addressable assets when you run your game in Play mode. When you select a Play Mode Script, it remains the active script until you choose a different one. The Play Mode Script has no effect on asset loading when you build and run your application outside the Unity Editor. The Play Mode Scripts include: * Use Asset Database: Loads assets directly from the Editor Asset Database, which is also used for all non-Addressable assets. You don't have to build your Addressable content when using this option. * Use Existing Build: Loads assets from bundles created by an earlier content build. You must run a full build using a Build Script such as Default Build Script before using this option. Remote content must be hosted at the RemoteLoadPath of the Profile used to build the content. #### Find an asset To locate an Addressable Asset in the Groups window, type all or part of its address, path, or a label into the filter control on the Groups window toolbar. Filtering the group list by the string "NP" to find all assets labeled NPC. Filtering the group list by the string "NP" to find all assets labeled NPC To locate the asset in your project, select it in the Groups window. Unity then selects the asset in the Project window and displays the asset's details in the Inspector window. ##### Tip ``` * To view the groups of the assets found, enable Hierarchical Search. Disable this option to only display groups if they match the search string. Select the magnifying glass icon in the search box to enable or disable Hierarchical Search. * To view sub-object addresses, such as the Sprites in a Sprite Atlas, enable the Show Sprite and Subobject Addresses option using the Tools menu on the Groups window toolbar. ``` #### Group context menu To open the Group context menu and access group-related commands, right-click on a group name. | **Command** | **Description** | | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Remove Group(s)** | Removes the Group and deletes its associated ScriptableObject asset. Unity reverts any assets in the group into non-Addressable assets. | | **Simplify Addressable Names** | Shortens the name of assets in the group by removing path-like components and extensions. | | **Set as Default** | Sets the group as the default group. When you mark an asset as Addressable without explicitly assigning a group, Unity adds the asset to the default group. | | **Inspect Group Settings** | Selects the group asset in the Unity Project window and in the Inspector window so that you can view the settings. | | **Rename** | Enables you to edit the name of the group. | | **Create New Group** | Creates a new group based on a group template. | #### Asset context menu To open the Addressable asset context menu and access asset-related commands, right-click on an asset. |**Command**|**Description**| |---|---| |**Move Addressables to Group**|Move the selected assets to a different, existing group.| |**Move Addressables to New Group**|Create a new group with the same settings as the current group and move the selected assets to it.| |**Remove Addressables**|Remove the selected assets from the Group and make the assets non-Addressable.| |**Simplify Addressable Names**|Shortens the names of the selected assets by removing path-like components and extensions.| |**Copy Address to CLipboard**|Copies the asset's assigned address string to your system Clipboard.| |**Change Address**|Edit the asset's name.| |**Create New Group**|Create a new group based on a group template. This doesn't move the selected assets.| # Build content overview # Distribute remote content # Use Addressable at runtime # Load Addressable assets # Diagnostic tools ## Analyze tool ## Addressables Profiler module ## Build layout report ## Build profile log ## Addressables Report window reference ### Addressables Report Inspector reference