Class AssetReferenceT<TObject> | Package Manager UI website
docs.unity.cn
    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)
    Back to top Copyright © 2015-2018 Unity
    Generated by DocFX