Method LoadAssets
LoadAssets<TObject>(IList<IResourceLocation>, Action<TObject>)
Load multiple assets
Declaration
[Obsolete]
public static AsyncOperationHandle<IList<TObject>> LoadAssets<TObject>(IList<IResourceLocation> locations, Action<TObject> callback)
Parameters
Type | Name | Description |
---|---|---|
IList<IResource |
locations | The locations of the assets. |
Action<TObject> | callback | Callback Action that is called per load operation. |
Returns
Type | Description |
---|---|
Async |
The operation handle for the request. |
Type Parameters
Name | Description |
---|---|
TObject | The type of the assets. |
LoadAssets<TObject>(IList<object>, Action<TObject>, MergeMode)
Load multiple assets
Declaration
[Obsolete]
public static AsyncOperationHandle<IList<TObject>> LoadAssets<TObject>(IList<object> keys, Action<TObject> callback, Addressables.MergeMode mode)
Parameters
Type | Name | Description |
---|---|---|
IList<object> | keys | List of keys for the locations. |
Action<TObject> | callback | Callback Action that is called per load operation. |
Addressables.Merge |
mode | Method for merging the results of key matches. See Addressables. |
Returns
Type | Description |
---|---|
Async |
The operation handle for the request. |
Type Parameters
Name | Description |
---|---|
TObject | The type of the assets. |
LoadAssets<TObject>(object, Action<TObject>)
Loads multiple assets, identified by a key.
Declaration
[Obsolete]
public static AsyncOperationHandle<IList<TObject>> LoadAssets<TObject>(object key, Action<TObject> callback)
Parameters
Type | Name | Description |
---|---|---|
object | key | Key for the locations. |
Action<TObject> | callback | Callback Action that is called per load operation. |
Returns
Type | Description |
---|---|
Async |
The operation handle for the request. |
Type Parameters
Name | Description |
---|---|
TObject | The type of the assets. |
Remarks
The key in key
is translated into lists of locations, which are merged into a single list based on
When you load Addressable assets, the system:
- Gathers the dependencies of the assets
- Downloads any remote AssetBundles needed to load the assets or their dependencies
- Loads the AssetBundles into memory
- Populates the
Result
object of the AsyncOperation instance returned by this functionHandle<TObject>
Use the Result
object to access the loaded assets.
If any assets cannot be loaded, the entire operation fails. The operation releases any assets and dependencies it had already loaded.
The Status
of the operation handle is set to Failed and the Result
is set to null.
See the Loading Addressable Assets documentation for more details.