A class in Root.Township, the global namespace.
Object pool with a hard limit (MaximumPoolSize): when it runs out it recycles the oldest active object instead of making a new one. PooledObjectDefinition creates it.
Constructors
Fields
2 private and internal fields
| Member | What it is |
|---|
private LinkedList<PooledObject> activeObjects | Objects handed out, oldest first. |
private static Logger logger | NLog logger for this class. |
Methods
| Member | What it is |
|---|
override void Release(PooledObject pooledObject, Action releaseCallback) | Takes an object back: removes it from the active list and stores it inactive, or destroys it if the pool is full. Warns on double release. |
override PooledObject Request(Vector3 position, Quaternion rotation) | Returns a pooled object, a new one, or the oldest active one when at the limit, placed at the given position and rotation. |