A lightweight and efficient pooling system built on top of Unity Addressables.
It allows you to load, reuse, and release assets dynamically while minimizing memory overhead and loading time.
This system combines Addressables and Object Pooling patterns to achieve:
- ✅ Dynamic loading of Addressable assets
- ✅ Reuse of instantiated objects without destroying them
- ✅ Memory-efficient lifecycle management
- ✅ Safe handling of AsyncOperationHandles (no invalid handle exceptions)
- ✅ Ready for both local and remote Addressables catalogs
AddressablePoolManager
- Manages all pools
- Handles loading & release
ObjectPool
- Stores inactive objects
- Reuses prefab instances
Pool Objects
- Used in scene
- Returned to pool
- Clone this repository into your Unity project’s
Assetsfolder:git clone https://github.com/yourname/Unity-Addressables-Pooling.git
- Ensure you have Addressables installed:
- In Unity Editor: Window → Package Manager → Addressables
- Build your Addressables groups:
- Open Window → Asset Management → Addressables → Groups
- Create your groups and mark prefabs with unique addresses
Spawning Addressable Objects
public class ExplosionSpawner : MonoBehaviour
{
[SerializeField] private AddressablePoolManager poolManager;
private async void Update()
{
if (Input.GetMouseButtonDown(0))
{
Vector3 pos = new Vector3(Random.Range(-3f, 3f), 0, 0);
GameObject explosion = await poolManager.Spawn("ExplosionPrefab", pos, Quaternion.identity);
// Return object to pool after 2 seconds
StartCoroutine(ReturnAfterDelay(explosion));
}
}
private IEnumerator ReturnAfterDelay(GameObject obj)
{
yield return new WaitForSeconds(2f);
poolManager.Despawn("ExplosionPrefab", obj);
}
}
AddressablePoolManager.cs
Handles all pool creation, asset loading, and safe handle releasing.
ObjectPool.cs
Stores inactive instances for reuse. Automatically creates new ones when needed.
Issue Cause Solution Attempting to use an invalid operation handle Handle released too early Check handle.IsValid() before releasing Duplicated prefab loads Missing address check Cache pools by address key Memory leaks Never releasing Addressables Always release handles in OnDestroy()
Async Preloading: Load frequently used assets on game start
Auto Return: Auto-release objects after use (timed or event-based)
Remote Catalogs: Integrate with CDN for live updates
Editor Debug Tools: Add pool visualization in inspector (via Odin or custom editor)