- Need Unity version 2021+
- Implemented using Unity ObjectPool
- Doesn't require the creation of additional objects on the scene
- Simplifies the use of the pool system.
- Import unitypackage from releases
- If examples aren't needed, uncheck the folder "Examples"
Use the static class DynamicPool from namespace SG.GLobal.PoolSystem
- DynamicPool.Get - use to spawn object
- DynamicPool.Return - use to release object
- DynamicPool.CreatePool - use to prespawn objects
- DynamicPool.Clear - clear pool for one object
- DynamicPool.ClearAll - clear pool for all objects
For use this method object must realize IPoolable interface.
Also you can use this methods to ParticleSystem. Then the necessary component will be added automatically and ParticleSystem will return to the pool when it is played to the end.
- OnTakeFromPool - this method called when object was took from pool
- OnReturnToPool - this method called when object was returned to pool
The available and spawned number of objects can be observed in the scene hierarchy.