riversong code showcase

This commit is contained in:
Daniele Marotta
2026-05-21 15:52:18 +02:00
commit 4c9eea1c02
462 changed files with 23406 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
using UnityEngine.Pool;
namespace DanieleMarotta.RiversongCodeShowcase
{
public class PoolingService : IPoolingService
{
private Dictionary<int, object> _poolLookup = new();
public void AddPool<T>(int key, IObjectPool<T> pool) where T : class
{
_poolLookup.Add(key, pool);
}
public IObjectPool<T> GetPool<T>(int key) where T : class
{
return _poolLookup.TryGetValue(key, out var pool) ? (IObjectPool<T>)pool : null;
}
}
}