Skip to content

objectpool

eisclimber edited this page Apr 4, 2026 · 2 revisions

ExPresSXR.Minigames.Archery.ObjectPool Namespace

Summary

Classes Implementing an object pooling system for the archery system.

Classes

Name Description
ObjectPool Helper class representing the data of a pool
ObjectPoolManager Allows the use of simple Object Pooling. This will create object instance if necessary. When an object is not needed it get returned to the pool and deactivated instead of destroyed. When there are unused objects in the pool, this object is returned insrtead of creating a completely new instance, saving time and resources.
Pooled Objects should ideally be a prefab and implement the IPooledObject interface to allow resetting certain components of the object like forces of rigidbodies. Position, rotation, parent transform and active status are reset automatically.

You can register a default pool manager to be globally accessible, by checking the option in its inspector. You should avoid setting multiple as default since they might interfere, messing up object return and retrieval.
If none is set, but you try to access it, a new one gets created. The actual use of the default manager as must be implemented by the components using it.

Pooling and object retrieval is based on the name of the provided object/prefab. It is basically the name of the object truncated to seven characters but allowing fewer. This needs to be taken in consideration when spawning similarly named prefabs using the same ObjectPoolManager to avoid naming collisions.| |PoolObjectDestroyTimer|Returns the attached GameObject to the configured (or default) pool.|

Interfaces

Name Description
IPoolObject Represents an object for which an object pool can execute functionality on return and retrieval.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally