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
[Serializable]
public class AssetReferenceT<TObject> : AssetReference, IKeyEvaluator where TObject : Object
Type Parameters
Name | Description |
---|---|
TObject |
Constructors
Name | Description |
---|---|
AssetReferenceT(String) | Construct a new AssetReference object. |
Methods
Name | Description |
---|---|
LoadAsset() | Load the referenced asset as type TObject. This cannot be used a second time until the first load is released. If you wish to call load multiple times on an AssetReference, use LoadAssetAsync<TObject>(Object) and pass your AssetReference in as the key. See the Loading Addressable Assets documentation for more details. |
LoadAssetAsync() | Load the referenced asset as type TObject. This cannot be used a second time until the first load is released. If you wish to call load multiple times on an AssetReference, useLoadAssetAsync<TObject>(Object) and pass your AssetReference in as the key. See the Loading Addressable Assets documentation for more details. |
ValidateAsset(String) | Validates that the asset located at a path is allowable for this asset reference. An asset is allowable if it is of the correct type or if one of its sub-asset is. |
ValidateAsset(Object) | Validates that the referenced asset allowable for this asset reference. |