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.
Inherited Members
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 |
---|---|---|
System.String | guid | The guid of the asset. |
Methods
LoadAssetAsync()
Load the referenced asset as type TObject.
Declaration
public 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 |
---|---|---|
System.Object | obj | The Object to validate. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the referenced asset is valid. |
Overrides
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. |