Example #1
0
    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;
        }
    }
Example #2
0
 public void Spawn()
 {
     myPool.GetPickup();
 }