Pool
Unity Pool utilities
Last updated
Unity Pool utilities
Last updated
Where objects never die, they just take a break.
Pool is a resource control system. It will keep objects in memory to become ready to use.
display name
AceLand Pool
package name
latest version
1.0.4
namespace
git repository
dependencies
Unity Engine has it's own pool system. However you need to set everything, what to do on take from or return to pool, including instantiate and destroy.
This package has already created all necessary code for pool running in official method. And additionally add some management settings on it.
On Create
Instantiate OwnedItemPrefab
On Get
Invoke PoolItem.OnTakeFromPool()
Parent to Target Parent
Enable the game object
On Return
Invoke PoolItem.OnReturnToPool()
Disable the game object
Parent to Pool Parent
On Destroy
Destory the game object
Create your Pool Item as an MonoBehaviour
Attach the component to GameObject and make it as a prefab
kindly add a line, you can setup your pool now
Owned Item Prefab
IPoolItem that made as prefab
Pool Parent
Transform that hold objects not taken out
Target Parent
Transform That hold objects taken out
Pool Type
Stack or LinkedList, read Pool Type section for details
Prewarm Size
start and min size of the pool
Max Size
max size of the pool
Collection Checks
check that the objects being returned to the pool are the same type as those that were originally pooled. this may cause performance issue.
Small Pool:
Stack: More efficient in terms of memory and performance for small sizes; simple to implement.
Linked List: May incur unnecessary overhead; less common unless specific behavior is required.
Large Pool:
Stack: Efficient but may require careful management of memory and resizing. Suitable if LIFO access is necessary.
Linked List: More flexible for dynamic sizes; better for frequent insertions/deletions, but with higher memory overhead.
Please read the about Object Pool.