Skip to main content

BasicPooledObjectPool

An abstract class in Root.Township, the global namespace.

Base pool for one PooledObjectDefinition. Fills itself with the initial pool size of inactive copies and empties on game reload. PooledObjectPool and MaxLimitPooledObjectPool derive from it.

Constructors​

MemberWhat it is
BasicPooledObjectPool(PooledObjectDefinition definition)Creates a BasicPooledObjectPool from definition.

Fields​

MemberWhat it is
protected readonly PooledObjectDefinition definitionThe definition this pool serves.
protected Stack<PooledObject> pooledObjectsInactive objects ready to hand out.

Methods​

MemberWhat it is
abstract void Release(PooledObject pooledObject, Action releaseCallback)Returns an object to the pool, then calls the callback.
abstract PooledObject Request(Vector3 position, Quaternion rotation)Takes an object from the pool at the given position and rotation.

Used in​

Members of other types that take, return or hold a BasicPooledObjectPool: