docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method LoadAssetAsync

    LoadAssetAsync<TObject>(IResourceLocation)

    Loads a single Addressable asset identified by an IResourceLocation.

    Declaration
    public static AsyncOperationHandle<TObject> LoadAssetAsync<TObject>(IResourceLocation location)
    Parameters
    Type Name Description
    IResourceLocation location

    The location of the asset.

    Returns
    Type Description
    AsyncOperationHandle<TObject>

    Returns the load operation.

    Type Parameters
    Name Description
    TObject

    The type of the asset.

    Remarks

    When you load an Addressable asset, the system:

    • Gathers the asset's dependencies
    • Downloads any remote AssetBundles needed to load the asset or its dependencies
    • Loads the AssetBundles into memory
    • Populates the Result object of the AsyncOperationHandle<TObject> instance returned by this function.

    Use the Result object to access the loaded assets.

    See Loading Addressable Assets for more information and examples.

    See Operations for information on handling the asynchronous operations used to load Addressable assets.

    LoadAssetAsync<TObject>(object)

    Loads a single Addressable asset identified by a key such as an address or label.

    Declaration
    public static AsyncOperationHandle<TObject> LoadAssetAsync<TObject>(object key)
    Parameters
    Type Name Description
    object key

    The key of the location of the asset.

    Returns
    Type Description
    AsyncOperationHandle<TObject>

    Returns the load operation.

    Type Parameters
    Name Description
    TObject

    The type of the asset.

    Remarks

    When you load an Addressable asset, the system:

    • Gathers the asset's dependencies
    • Downloads any remote AssetBundles needed to load the asset or its dependencies
    • Loads the AssetBundles into memory
    • Populates the Result object of the AsyncOperationHandle<TObject> instance returned by this function.

    Use the Result object to access the loaded assets.

    Note that if you provide a key, such as a label, that maps to more than one asset, only the first object encountered by the loading operation is returned. Use LoadAssetsAsync<TObject>(object, Action<TObject>) or one of its overloads to load multiple assets in a single operation.

    See Loading Addressable Assets for more information and examples.

    See Operations for information on handling the asynchronous operations used to load Addressable assets.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)