Class AddressablesExtensions
Addressables Based Extension Methods
Inheritance
Namespace: GDX
Syntax
[VisualScriptingCompatible((short)2)]
public static class AddressablesExtensions
Remarks
Requires UnityEngine.CoreModule.dll to function correctly.
Requires com.unity.addressables
Package.
Methods
| Improve this Doc View SourceCanInstantiate(AssetReference)
Can targetAssetReference
be instantiated at runtime?
Declaration
public static bool CanInstantiate(this AssetReference targetAssetReference)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.AddressableAssets.AssetReference | targetAssetReference | The target UnityEngine.AddressableAssets.AssetReference. |
Returns
Type | Description |
---|---|
System.Boolean | true/false |
Remarks
Checks that it is not empty, has a runtime key, and makes sure the key is valid.
CanRelease(AsyncOperationHandle<GameObject>, Boolean)
Can the targetAsyncOperationHandle
be released?
Declaration
public static bool CanRelease(this AsyncOperationHandle<GameObject> targetAsyncOperationHandle, bool autoRelease = false)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<UnityEngine.GameObject> | targetAsyncOperationHandle | A target UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle<TObject> typed as UnityEngine.GameObject. |
System.Boolean | autoRelease | If it can, should the handle release? |
Returns
Type | Description |
---|---|
System.Boolean | true/false |
HasRuntimeKey(AssetReference)
Does targetAssetReference
have a runtime key?
Declaration
public static bool HasRuntimeKey(this AssetReference targetAssetReference)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.AddressableAssets.AssetReference | targetAssetReference | The target UnityEngine.AddressableAssets.AssetReference. |
Returns
Type | Description |
---|---|
System.Boolean | true/false |
Remarks
Will return false if the reference is null.
IsEmpty(AssetReference)
Is targetAssetReference
empty?
Declaration
public static bool IsEmpty(this AssetReference targetAssetReference)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.AddressableAssets.AssetReference | targetAssetReference | The target UnityEngine.AddressableAssets.AssetReference. |
Returns
Type | Description |
---|---|
System.Boolean | true/false |