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, IKeyEvaluatorType 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
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. |