Class ElasticObjectPoolManager
Default object pooling implementation using the PooledObject component to mark prefabs for
object pooling.
Inheritance
ElasticObjectPoolManager
Assembly: Holoride.ElasticSDK.Runtime.dll
Syntax
[ContextProvider(typeof(PrefabInstantiationContext))]
[HelpURL("http://localhost:8080/api/Holoride.ElasticSDK.ElasticObjectPoolManager.html")]
public class ElasticObjectPoolManager : MonoBehaviour, IPrefabInstantiationProvider, IContextProvider
Fields
DefaultSettings
Default pool settings that will be used if there was no specific settings asset for an individual pool specified.
Declaration
[Tooltip("Default pool settings that will be used if there was no specific settings asset for an individual pool specified.")]
public ElasticObjectPoolDefaultSettings DefaultSettings
Field Value
PoolSettings
Declaration
public List<ElasticObjectPoolSettings> PoolSettings
Field Value
Properties
IsDirty
Declaration
public bool IsDirty { get; }
Property Value
Methods
Clear(PooledObject)
Manually clears (but does not destroy) a pool in the context dictionary.
Declaration
public void Clear(PooledObject poolKey)
Parameters
Type |
Name |
Description |
PooledObject |
poolKey |
The component key of the pool that should be cleared.
|
ClearAll()
Manually clears (but does not destroy) all pools in the context dictionary.
Declaration
Despawn(GameObject)
Declaration
public bool Despawn(GameObject instance)
Parameters
Returns
Init(GameObject, Action<GameObject>)
Declaration
[Obsolete("Use the async overload instead.")]
public IEnumerator Init(GameObject prefab, Action<GameObject> initAction = null)
Parameters
Returns
InitAsync(GameObject, Action<GameObject>, CancellationToken)
Declaration
public UniTask InitAsync(GameObject prefab, Action<GameObject> initAction = null, CancellationToken cancellationToken = default)
Parameters
Returns
Type |
Description |
Cysharp.Threading.Tasks.UniTask |
|
ProvideContextAsync(GenerationSettings, GenerationContext, ISet<Type>, CancellationToken)
Declaration
public UniTask ProvideContextAsync(GenerationSettings settings, GenerationContext context, ISet<Type> requiredContextTypes, CancellationToken cancellationToken)
Parameters
Returns
Type |
Description |
Cysharp.Threading.Tasks.UniTask |
|
Spawn(GameObject, Vector3, Quaternion, Vector3, Func<GameObject, UniTask>, CancellationToken)
Declaration
public UniTask<(bool Success, GameObject Result)> Spawn(GameObject prefab, Vector3 position, Quaternion rotation, Vector3 scale, Func<GameObject, UniTask> preSpawnAction = null, CancellationToken cancellationToken = default)
Parameters
Returns
Type |
Description |
Cysharp.Threading.Tasks.UniTask<T><(bool Success, GameObject Result)> |
|
Implements