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.
Implements
Inherited Members
Namespace: UnityEngine.AddressableAssets
Assembly: Unity.Addressables.dll
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. |
Properties
Name | Description |
---|---|
DerivedClassType | |
editorAsset | Type-specific override of parent editorAsset. Used by the editor to represent the main asset referenced. |
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, use LoadAssetAsync<TObject>(object) and pass your AssetReference in as the key. on an AssetReference, use Addressables.LoadAssetAsync<>() 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. |