private void Update() { //chooses between a random pool to spawn if (timeBetweenSpawn <= 0) { int rand = Random.Range(0, obstaclePattern.Length); timeBetweenSpawn = startTimeBetweenSpawn; Pooler myPool = obstaclePattern[rand].GetComponent <Pooler>(); myPool.GetPickup(); } else { timeBetweenSpawn -= Time.deltaTime; } }
public void Spawn() { myPool.GetPickup(); }