public void Collect() { runManager.InreaseCoinAmount(); Debug.Log("Zebrano monetę, ilość monet: " + runManager.CoinAmount); poolMember.Despawn(); nextCoinPosition = levelPlanner.GenerateNextCoinPosition(); poolMember.myPool.Spawn(nextCoinPosition, Quaternion.identity); }
void InitializeCoins() { coinPool = new ObjectPooler(coinPrefab, 10); for (int i = 0; i < 10; i++) { coinPool.Spawn(levelPlanner.GenerateNextCoinPosition(), Quaternion.identity); } }