Group settings
Group settings determine how the assets in a group are treated in content builds. For example, you can specify where AssetBundles are built, bundle compression settings, and so on.
A group's settings are declared in Schema objects attached to the group. When you create a group with the Packed Assets template, the Content Packing & Loading and Content Update Restriction schemas define the settings for the group. These settings are expected by the default Build scripts.
The Inspector window for the Default Local Group
Note
If you create a group with the Blank template, then no schemas are attached to the group. Assets in such a group cannot be processed by the default build scripts.
Content Packing & Loading settings
Build and Load Paths
The Build and Load Paths settings of the Content Packing & Loading schema determine where the artifacts for your content builds are created and where the Addressables system should look for them at runtime.
Building and loading paths
Setting | Purpose |
---|---|
Build & Load Paths | The Profile path pair that defines where the Addressables build system creates artifacts for this group and where the Addressables system loads those artifacts at runtime. Choose a path pair from the list or select <custom> if you want to set the build and load paths separately. |
Build Path | A Profile variable that defines where the Addressables build system creates artifacts for this group. You can also set a custom string. Use one of the following for the build path: - LocalBuildPath: use for assets that you plan to distribute as part of your application installation. - RemoteBuildPath: use for assets that you plan to distribute using a remote hosting service such Unity Cloud Content Delivery or other Content Delivery Network. - <custom>: specify a string as the build path for this group. Only shown if you set Build & Load Paths to <custom> . |
Load Path | A Profile variable that defines where the Addressables system loads the build artifacts for this group at runtime. You can also set a custom string. Use one of the following for the load path: - LocalLoadPath: use for assets that you plan to distribute as part of your application installation. - RemoteLoadPath: use for assets that you plan to distribute using a remote hosting service such Unity Cloud Content Delivery or other Content Delivery Network. - <custom>: specify a string as the load path for this group. Only shown if you set Build & Load Paths to <custom> . |
The build and load path options are defined by variables in your Profiles. Note that only variables intended for a given purpose should be used for a setting. For example, choosing a load path variable for a build path setting wouldn't give you a useful result.
When you choose a Profile variable, the current evaluation of the path is shown in the Path Preview. Components of the path in braces, such as {UnityEngine.AddressableAssets.Addressable.RuntimePath}
, indicate that static variable is used to construct the final path at runtime. That portion of the path is replaced by the current value of the static variable when the Addressables system initializes at runtime.
Warning
In most cases, you should not 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.
See Profiles for more information.
Advanced Options
The Advanced Options section
Setting | Purpose |
---|---|
Asset Bundle Compression | The compression type for all bundles produced from the group. LZ4 is usually the most efficient option, but other options can be better in specific circumstances. See AssetBundle Compression for more information. |
Include In Build | Whether to include assets in this group in a content build. |
Force Unique Provider | Whether Addressables uses unique instances of Resource Provider classes for this group. Enable this option if you have custom Provider implementations for the asset types in this group and instances of those Providers must not be shared between groups. |
Use Asset Bundle Cache | Whether to cache remotely distributed bundles. |
Asset Bundle CRC | Whether to verify a bundle's integrity before loading it. • Disabled: Never check bundle integrity. • Enabled, Including Cached: Always check bundle integrity. • Enabled, Excluding Cached: Check integrity of bundles when downloading. |
Use UnityWebRequest for Local Asset Bundles | Load local AssetBundle archives from this group using UnityWebRequestAssetBundle.GetAssetBundle instead of AssetBundle.LoadFromFileAsync. |
Request Timeout | The timeout interval for downloading remote bundles. |
Use Http Chunked Transfer | Whether to use the HTTP/1.1 chunked-transfer encoding method when downloading bundles. Deprecated and ignored in Unity 2019.3+. |
Http Redirect Limit | The number of redirects allowed when downloading bundles. Set to -1 for no limit. |
Retry Count | The number of times to retry failed downloads. |
Include Addresses in Catalog | Whether to include the address strings in the catalog. If you don't load assets in the group using their address strings, you can decrease the size of the catalog by not including them. |
Include GUIDs in Catalog | Whether to include GUID strings in the catalog. You must include GUID strings to access an asset with an AssetReference. If you don't load assets in the group using AssetReferences or GUID strings, you can decrease the size of the catalog by not including them. |
Include Labels in Catalog | Whether to include label strings in the catalog. If you don't load assets in the group using labels, you can decrease the size of the catalog by not including them. |
Internal Asset Naming Mode | How to name assets in the catalog internally: - Full Path: the assets full path in the Project - Filename: the asset's filename - GUID: the assets GUID string - Dynamic: the Addressables system chooses the smallest internal named based on the assets in the group |
Internal Bundle Id Mode | Determines how to construct the internal Id of an AssetBundle. For example, when you set the Group Guid option, Addressables creates the bundle Id by combining the group name with a bundle GUID string. |
Cache Clear Behavior | Determines when an installed application clears AssetBundles from the cache. |
Bundle Mode | How to pack the assets in this group into bundles: - Pack Together: create a single bundle containing all assets. - Pack Separately: create a bundle for each primary asset in the group. Subassets, such as Sprites in a Sprite sheet are packed together. Assets within a folder added to the group are also packed together. - Pack Together by Label: create a bundle for assets sharing the same combination of labels. |
Bundle Naming Mode | How to construct the file names of AssetBundles. |
Asset Load Mode | Whether to load assets individually as you request them (the default) or always load all assets in the group together. |
Asset Provider | Defines which Provider class Addressables uses to load assets from the AssetBundles generated from this group. Set this option to Assets from Bundles Provider unless you have a custom Provider implementation to provide assets from an AssetBundle. |
Asset Bundle Provider | Defines which Provider class Addressables uses to load AssetBundles generated from this group. Set this option to AssetBundle Provider unless you have a custom Provider implementation to provide AssetBundles. |
Content Update Restriction
The Content Update Restriction options determine how the [Check for Content Update Restrictions] tool treats assets in the group. Run this tool to prepare your groups for a differential content update build (rather than a full content build). The tool moves modified assets in any groups set to Cannot Change Post Release to a new group.
The Update Restriction options include:
- Can Change Post Release: No assets are moved by the tool. If any assets in the bundle have changed, then the entire bundle is rebuilt.
- Cannot Change Post Release: If any assets in the bundle have changed, then the [Check for Content Update Restrictions] tool moves them to a new group created for the update. When you make the update build, the assets in the AssetBundles created from this new group override the versions found in the existing bundles.
See Content update builds for more information.
Group templates
A Group template defines which types of schema objects are created 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 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:
- Navigate to the desired location in your Assets folder using the Project panel.
- Create a Blank Group Template (menu: Assets > Addressables > Group Templates > Blank Group Templates).
- Assign a suitable name to the template.
- In the Inspector window, add a description, if desired.
- Click the Add Schema button and choose from the list of schemas.
- Continue adding schemas until all required schemas are added to the list.
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. See Builds for more information.
Schemas
A group schema is a ScriptableObject that defines a collection of settings for an Addressables group. You can assign any number of schemas to a group. The Addressables system defines a number of schemas for its own purposes. You can also create custom schemas to support your own build scripts and utilities.
The built-in schemas include:
- Content Packing & Loading: this is the main Addressables schema used by the default build script and defines the settings for building and loading Addressable assets.
- Content Update Restrictions: defines settings for making differential updates of a previous build. See Builds for more information about update builds.
- Resources and Built In Scenes: a special-purpose schema defining settings for which types of built-in assets to display in the Built In Data group.
Defining custom schemas
To create your own schema, extend the AddressableAssetGroupSchema class (which is a kind of ScriptableObject).
using UnityEditor.AddressableAssets.Settings;
public class __CustomSchema __: AddressableAssetGroupSchema
{
public string CustomDescription;
}
Once you have defined your custom schema object, you can add it to existing groups and group templates using the Add Schema buttons found on the Inspector windows of those entities.
You might also want to create a custom Editor script to help users interact with your custom settings. See Custom Inspector scripts.
In a build script, you can access the schema settings for a group using its AddressableAssetGroup object.