![]() |
Infohazard.Core.Addressables 1.0.0
Infohazard Core Addressables Integration
|
Only used internally. More...
Classes | |
class | PropNames |
This is used to refer to the names of private fields in this class from a custom Editor. More... | |
Public Member Functions | |
AddressableSpawnRefBase () | |
Default constructor (needed for Unity serialization). More... | |
AddressableSpawnRefBase (AssetReferenceGameObject assetReference) | |
Construct with a given asset reference. More... | |
override string | ToString () |
virtual UniTask | RetainAndWaitAsync () |
Add a user to the AddressableSpawnRef, creating the AddressablePoolHandler if necessary. If not already loaded, the prefab will be loaded asynchronously. More... | |
virtual async UniTask | WaitUntilLoadedAsync () |
If the prefab is currently loading, wait until it is done asynchronously. More... | |
virtual void | RetainAndWait () |
Add a user to the AddressableSpawnRef, creating the AddressablePoolHandler if necessary. If not already loaded, the prefab will be loaded and block. More... | |
virtual void | WaitUntilLoaded () |
If the prefab is currently loading, wait until it is done synchronously. More... | |
virtual void | Retain () |
Add a user to the AddressableSpawnRef, creating the AddressablePoolHandler if necessary. More... | |
virtual void | Release () |
Remove a user from the AddressableSpawnRef, in turn releasing the IPoolHandler. More... | |
T | Spawn (in SpawnParams spawnParams=default) |
Spawn an instance of Prefab. The AddressableSpawnRef MUST be retained. More... | |
Protected Attributes | |
AssetReferenceGameObject | _assetReference |
(Serialized) Reference to the addressable prefab to spawn. More... | |
Properties | |
AssetReferenceGameObject | AssetReference [get] |
Reference to the addressable prefab to spawn. More... | |
bool | IsValid [get] |
Whether there is a valid asset reference. More... | |
bool | Loaded [get] |
Whether the referenced asset has been loaded successfully and the AddressableSpawnRef is retained at least once. More... | |
int | RetainCount [get, private set] |
Number of users of the AddressableSpawnRef More... | |
T | Prefab [get] |
Prefab to be spawned, if it is loaded. More... | |
Only used internally.
Similar to SpawnRef, but for spawning addressable prefabs.
T | The type of object to be referenced. |
T | : | Object |
Default constructor (needed for Unity serialization).
Infohazard.Core.Addressables.AddressableSpawnRefBase< T >.AddressableSpawnRefBase | ( | AssetReferenceGameObject | assetReference | ) |
Construct with a given asset reference.
assetReference | The prefab to be spawned. |
|
virtual |
Remove a user from the AddressableSpawnRef, in turn releasing the IPoolHandler.
|
virtual |
Add a user to the AddressableSpawnRef, creating the AddressablePoolHandler if necessary.
Does not wait for the loading to finish.
|
virtual |
Add a user to the AddressableSpawnRef, creating the AddressablePoolHandler if necessary. If not already loaded, the prefab will be loaded and block.
|
virtual |
Add a user to the AddressableSpawnRef, creating the AddressablePoolHandler if necessary. If not already loaded, the prefab will be loaded asynchronously.
If the prefab is already loaded, this will return synchronously.
T Infohazard.Core.Addressables.AddressableSpawnRefBase< T >.Spawn | ( | in SpawnParams | spawnParams = default | ) |
Spawn an instance of Prefab. The AddressableSpawnRef MUST be retained.
If the addressable has not yet finished loading, it will block until done. For this reason, you should Retain the AddressableSpawnRef well in advance of needing to spawn.
spawnParams | Additional spawn info. |
override string Infohazard.Core.Addressables.AddressableSpawnRefBase< T >.ToString | ( | ) |
|
virtual |
If the prefab is currently loading, wait until it is done synchronously.
This will not start loading the prefab if it is not already loading.
|
virtual |
If the prefab is currently loading, wait until it is done asynchronously.
This will not start loading the prefab if it is not already loading.
|
protected |
(Serialized) Reference to the addressable prefab to spawn.
|
get |
Reference to the addressable prefab to spawn.
|
get |
Whether there is a valid asset reference.
|
get |
Whether the referenced asset has been loaded successfully and the AddressableSpawnRef is retained at least once.
|
get |
Prefab to be spawned, if it is loaded.
|
getprivate set |
Number of users of the AddressableSpawnRef