Method LoadContentCatalogAsync
LoadContentCatalogAsync(string, string)
Additively load catalogs from runtime data.
Declaration
public static AsyncOperationHandle<IResourceLocator> LoadContentCatalogAsync(string catalogPath, string providerSuffix = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | catalogPath | The path to the runtime data. Must end with the catalog file name. |
| string | providerSuffix | This value, if not null or empty, will be appended to all provider ids loaded from this data. |
Returns
| Type | Description |
|---|---|
| AsyncOperationHandle<IResourceLocator> | The operation handle for the request. |
Remarks
You can cache content catalog by providing the hash file created for the catalog by the Addressables content build at the same URL as the catalog file. The Addressables system uses this hash file to determine if the cached catalog needs to be updated. If the value in the hash file has not changed since the last time you loaded the same catalog, this function loads the cached version instead of downloading the catalog. If the hash value has changed or if no hash file is provided, Addressables downloads the catalog from the specified path before loading it into memory.
The path must end with the catalog file name. Addressables reads that name from the
end to get the catalog's extension and to find the matching hash file. If the path
has a query string, the catalog file name must be its last value, as in a Unity CCD
URL ending ?path=/catalog_a1b2.bin.
See also: Managing catalogs at runtime
LoadContentCatalogAsync(string, bool, string)
Additively load catalogs from runtime data.
Declaration
public static AsyncOperationHandle<IResourceLocator> LoadContentCatalogAsync(string catalogPath, bool autoReleaseHandle, string providerSuffix = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | catalogPath | The path to the runtime data. Must end with the catalog file name. |
| bool | autoReleaseHandle | If true, the async operation handle will be automatically released on completion. Typically, there is no reason to hold on to the handle for this operation. |
| string | providerSuffix | This value, if not null or empty, will be appended to all provider ids loaded from this data. |
Returns
| Type | Description |
|---|---|
| AsyncOperationHandle<IResourceLocator> | The operation handle for the request. |
Remarks
You can cache content catalog by providing the hash file created for the catalog by the Addressables content build at the same URL as the catalog JSON file. The Addressables system uses this hash file to determine if the cached catalog needs to be updated. If the value in the hash file has not changed since the last time you loaded the same catalog, this function loads the cached version instead of downloading the catalog. If the hash value has changed or if no hash file is provided, Addressables downloads the catalog from the specified path before loading it into memory.
The path must end with the catalog file name. Addressables reads that name from the
end to get the catalog's extension and to find the matching hash file. If the path
has a query string, the catalog file name must be its last value, as in a Unity CCD
URL ending ?path=/catalog_a1b2.bin.
See also: Managing catalogs at runtime