Пример #1
0
    } // end Shield

    public void ShieldDown()
    {
        // power down
        shield.SetActive(false);
        collider.enabled = true;
        powerupUI.Deactive(1);
    } // end ShieldDown
Пример #2
0
    public IEnumerator Firerate()
    {
        fireRateDown = Time.time + powerupTime;
        if (fireRatePower == false)
        {
            // power up
            fireRatePower = true;
            fireRate      = fireRate / 2;
            powerupUI.Active(1);

            // wait for timer to run out
            yield return(new WaitWhile(() => fireRateDown > Time.time));

            // power down
            fireRate      = fireRate * 2;
            fireRatePower = false;
            powerupUI.Deactive(1);
        }
    }