Class AssetReferenceT<TObject> | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class AssetReferenceT<TObject>

    Generic version of AssetReference class. This should not be used directly as CustomPropertyDrawers do not support generic types. Instead use the concrete derived classes such as AssetReferenceGameObject.

    Inheritance
    System.Object
    AssetReference
    AssetReferenceT<TObject>
    AssetReferenceGameObject
    AssetReferenceSprite
    AssetReferenceTexture
    AssetReferenceTexture2D
    AssetReferenceTexture3D
    Inherited Members
    AssetReference.RuntimeKey
    AssetReference.Asset
    AssetReference.ToString()
    AssetReference.LoadAsset<TObject>()
    AssetReference.Instantiate(Vector3, Quaternion, Transform)
    AssetReference.Instantiate(Transform, Boolean)
    AssetReference.ReleaseAsset()
    AssetReference.ReleaseInstance(GameObject)
    Namespace: UnityEngine.AddressableAssets
    Syntax
    public class AssetReferenceT<TObject> : AssetReference
    Type Parameters
    Name Description
    TObject

    Methods

    LoadAsset()

    Load the referenced asset as type TObject.

    Declaration
    public IAsyncOperation<TObject> LoadAsset()
    Returns
    Type Description
    IAsyncOperation<TObject>

    The load operation.

    ValidateAsset(Object)

    Validates that the referenced asset allowable for this asset reference.

    Declaration
    public override bool ValidateAsset(object obj)
    Parameters
    Type Name Description
    System.Object obj

    The Object to validate.

    Returns
    Type Description
    System.Boolean

    Whether the referenced asset is valid.

    Overrides
    AssetReference.ValidateAsset(Object)

    ValidateAsset(String)

    Validates that the referenced asset allowable for this asset reference.

    Declaration
    public override bool ValidateAsset(string path)
    Parameters
    Type Name Description
    System.String path

    The path to the asset in question.

    Returns
    Type Description
    System.Boolean

    Whether the referenced asset is valid.

    Overrides
    AssetReference.ValidateAsset(String)
    In This Article
    • Methods
      • LoadAsset()
      • ValidateAsset(Object)
      • ValidateAsset(String)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023