Click or drag to resize

PoolHelper Class

Simple static helper class for pooling Unity prefab instances. If the pooled objects implement IPoolable they will be notified when they're spawned and despawned. For non-Unity objects see PoolHelperT.
Inheritance Hierarchy
SystemObject
  Archon.SwissArmyLib.PoolingPoolHelper

Namespace:  Archon.SwissArmyLib.Pooling
Assembly:  Archon.SwissArmyLib (in Archon.SwissArmyLib.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static class PoolHelper
Request Example View Source

The PoolHelper type exposes the following members.

Methods
  NameDescription
Public methodStatic memberDespawn(Object)
Despawns an instance and marks it for reuse.
Public methodStatic memberDespawn(Object, Single, Boolean)
Despawns an instance after a delay.
Public methodStatic memberGetFreeCount
Gets the amount of free instances in the pool for the specified prefab.
Public methodStatic memberGetPool
Gets or creates the pool for the given prefab.
Public methodStatic memberGetPrefab(Object)
Gets the prefab that was used to spawn instance.
Public methodStatic memberGetPrefabT(T)
Gets the prefab that was used to spawn instance.
Public methodStatic memberSpawnT(T)
Spawns a recycled object if there's one available, otherwise creates a new instance.
Public methodStatic memberSpawnT(T, Transform)
Spawns a recycled object if there's one available, otherwise creates a new instance.
Public methodStatic memberSpawnT(T, Vector3)
Spawns a recycled object if there's one available, otherwise creates a new instance.
Public methodStatic memberSpawnT(T, Vector3, Quaternion)
Spawns a recycled object if there's one available, otherwise creates a new instance.
Public methodStatic memberSpawnT(T, Vector3, Quaternion, Transform)
Spawns a recycled object if there's one available, otherwise creates a new instance.
Top
See Also