Skip to content

Repository files navigation

RePool

unity object pool

Installation

https://github.com/stupeak/RePool.git?path=Assets/RePool

Pool Containers

// base interface for pool containersinterfaceIPoolContainer<T>// UnityEngine.Component pool
class ComponentPool<T>// ComponentPool<TValue> with keysclass MultiComponentPool<TKey, TValue>// UnityEngine.GameObject poolclass GameObjectPool

Examples

usingStupeak.RePool;classBullet{}ComponentPool<Bullet>bulletPool=new(bulletPrefab,bulletParent);BulletbulletInstance=bulletPool.Rent();// adding a new instancebulletPool.AddExisting(newBullet());// return to poolbulletPool.Return(bulletInstance);// release instance bulletPool.Release(bulletInstance);

About

Object Pooling for Unity

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages