An IPoolHandler that loads an addressable from a key.
More...
An IPoolHandler that loads an addressable from a key.
◆ AddressablePoolHandler()
Infohazard.Core.Addressables.AddressablePoolHandler.AddressablePoolHandler |
( |
object |
key, |
|
|
Transform |
transform |
|
) |
| |
Construct AddressablePoolHandler given addressable key and parent transform.
- Parameters
-
key | Key of the addressable to spawn (path or GUID). |
transform | Transform to parent inactive pooled objects to. |
◆ Clear()
override void Infohazard.Core.Addressables.AddressablePoolHandler.Clear |
( |
| ) |
|
|
protected |
Destroy all pooled instances and unload the addressable if it is loaded.
◆ Despawn()
override void Infohazard.Core.Addressables.AddressablePoolHandler.Despawn |
( |
Spawnable |
instance | ) |
|
◆ Destroy()
override void Infohazard.Core.Addressables.AddressablePoolHandler.Destroy |
( |
Spawnable |
obj | ) |
|
|
protected |
◆ Instantiate()
override Spawnable Infohazard.Core.Addressables.AddressablePoolHandler.Instantiate |
( |
| ) |
|
|
protected |
◆ Retain()
override void Infohazard.Core.Addressables.AddressablePoolHandler.Retain |
( |
| ) |
|
◆ RetainAndWait()
void Infohazard.Core.Addressables.AddressablePoolHandler.RetainAndWait |
( |
| ) |
|
◆ RetainAndWaitAsync()
UniTask Infohazard.Core.Addressables.AddressablePoolHandler.RetainAndWaitAsync |
( |
| ) |
|
Add a user to the AddressablePoolHandler. If not already loaded, the prefab will be loaded asynchronously.
If the prefab is already loaded, this will return synchronously.
◆ ShouldClear()
override bool Infohazard.Core.Addressables.AddressablePoolHandler.ShouldClear |
( |
| ) |
|
|
protected |
Unlike a DefaultPoolHandler, an AddressablePoolHandler should only clear if both the DefaultPoolHandler.RetainCount (users) and ReferenceCount (spawned objects) are zero. This is because unloading the addressable will also unload any assets needed by the spawned instances, causing missing materials/meshes/textures, etc.
- Returns
- Whether the pooled instances should be cleared and the addressable unloaded.
◆ Spawn()
override Spawnable Infohazard.Core.Addressables.AddressablePoolHandler.Spawn |
( |
| ) |
|
◆ ToString()
override string Infohazard.Core.Addressables.AddressablePoolHandler.ToString |
( |
| ) |
|
◆ WaitUntilLoaded()
void Infohazard.Core.Addressables.AddressablePoolHandler.WaitUntilLoaded |
( |
| ) |
|
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.
◆ WaitUntilLoadedAsync()
async UniTask Infohazard.Core.Addressables.AddressablePoolHandler.WaitUntilLoadedAsync |
( |
| ) |
|
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.
◆ Key
object Infohazard.Core.Addressables.AddressablePoolHandler.Key |
|
get |
Key of the addressable to spawn (path or GUID).
◆ LoadOperation
AsyncOperationHandle<GameObject> Infohazard.Core.Addressables.AddressablePoolHandler.LoadOperation |
|
getprivate set |
Loading operation for the addressable if it is loading or loaded.
◆ ReferenceCount
int Infohazard.Core.Addressables.AddressablePoolHandler.ReferenceCount |
|
getprivate set |
◆ State
LoadState Infohazard.Core.Addressables.AddressablePoolHandler.State |
|
getprivate set |
State of loading the given addressable.
The documentation for this class was generated from the following file:
- Runtime/AddressablePoolHandler.cs