private T Spawn <T, TI, TS>(PoolItem <T, TI, TS> poolItem, TI instantiateArguments, TS spawnArguments) where TI : PoolItemInstantiateProvider where TS : PoolItemSpawnProvider { var obj = poolItem.PooledItems.Count == 0 ? Instantiate(poolItem, instantiateArguments) : poolItem.PooledItems.Dequeue(); poolItem.OnSpawn(Game, obj, spawnArguments); return(obj); }