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. |
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.
See also: Managing catalogs at runtime
LoadContentCatalogAsync(String, Boolean, 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. |
Boolean | 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.
See also: Managing catalogs at runtime