Ejemplo n.º 1
0
    void Update()
    {
        if (!powerUpSpawned)
        {
            powerUpSpawnManager.Spawn("CircleBall"); // If there is another power ups, we can choose them randomly in a list.
            powerUpSpawned = true;

            if (!powerUpSpawnManager.IsAllObjectsSpawned) // If the size of object pool greater than 1, spawn the others as well
            {
                StartCoroutine(PowerUpSpawning(PowerUpSpawningTimeInSeconds));
            }
        }

        if (powerUpTaken)
        {
            StartCoroutine(PowerUpSpawning(PowerUpSpawningTimeInSeconds));
            powerUpTaken = false;
        }
    }