Class AssetReferenceT<TObject> | Addressables | 1.6.2
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
    Object
    AssetReference
    AssetReferenceT<TObject>
    AssetReferenceAtlasedSprite
    AssetReferenceGameObject
    AssetReferenceSprite
    AssetReferenceTexture
    AssetReferenceTexture2D
    AssetReferenceTexture3D
    Inherited Members
    AssetReference.RuntimeKey
    AssetReference.AssetGUID
    AssetReference.SubObjectName
    AssetReference.IsValid()
    AssetReference.IsDone
    AssetReference.Asset
    AssetReference.ToString()
    AssetReference.LoadAsset<TObject>()
    AssetReference.LoadScene()
    AssetReference.Instantiate(Vector3, Quaternion, Transform)
    AssetReference.Instantiate(Transform, Boolean)
    AssetReference.LoadAssetAsync<TObject>()
    AssetReference.LoadSceneAsync(LoadSceneMode, Boolean, Int32)
    AssetReference.UnLoadScene()
    AssetReference.InstantiateAsync(Vector3, Quaternion, Transform)
    AssetReference.InstantiateAsync(Transform, Boolean)
    AssetReference.RuntimeKeyIsValid()
    AssetReference.ReleaseAsset()
    AssetReference.ReleaseInstance(GameObject)
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.AddressableAssets
    Syntax
    public class AssetReferenceT<TObject> : AssetReference, IKeyEvaluator
    Type Parameters
    Name Description
    TObject

    Constructors

    AssetReferenceT(String)

    Construct a new AssetReference object.

    Declaration
    public AssetReferenceT(string guid)
    Parameters
    Type Name Description
    String guid

    The guid of the asset.

    Methods

    LoadAsset()

    Load the referenced asset as type TObject.

    Declaration
    [Obsolete]
    public AsyncOperationHandle<TObject> LoadAsset()
    Returns
    Type Description
    AsyncOperationHandle<TObject>

    The load operation.

    LoadAssetAsync()

    Load the referenced asset as type TObject.

    Declaration
    public virtual AsyncOperationHandle<TObject> LoadAssetAsync()
    Returns
    Type Description
    AsyncOperationHandle<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
    Object obj

    The Object to validate.

    Returns
    Type Description
    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
    String path

    The path to the asset in question.

    Returns
    Type Description
    Boolean

    Whether the referenced asset is valid.

    Overrides
    AssetReference.ValidateAsset(String)
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX