EzPooler is a Unity package that provides an efficient way to manage object pooling in your game.
- Efficient object pooling to improve performance.
- Easy-to-use methods for spawning and despawning gameobjects.
- Support for pre-instantiating and caching gameobjects in the Unity Editor for efficient use during gameplay.
In unity editor inside package manager:
- Hit
(+)
, chooseAdd package from Git URL
(Unity 2019.4+) - Paste the
URL
for this package inside the box: https://github.com/ebukaracer/EzPooler.git#upm - Hit
Add
- If you're using assembly definition in your project, be sure to add this package's reference under:
Assembly Definition References
or check out this
using Racer.EzPooler.Core;
using UnityEngine;
public class ExampleUsage : MonoBehaviour
{
[SerializeField] private GameObject prefab;
private PoolManager _poolManager;
private void Start()
{
_poolManager = GetComponent<PoolManager>();
// Spawn an object
var spawnedObject = _poolManager.SpawnObject(Vector3.zero, Quaternion.identity);
// Despawn the object after 2 seconds
spawnedObject.InvokeDespawn(2f);
}
}
Check out this package's sample scene by importing it from the package manager sample's tab and exploring the scripts for the recommended approach for pooling gameobjects in your game.
To remove this package completely(leaving no trace), navigate to: Racer > EzPooler > Remove package
Contributions are welcome! Please open an issue or submit a pull request.