} // end StartPowerup private void Shield() { if (shield.activeSelf) { return; } else { // power up shield.SetActive(true); collider.enabled = false; powerupUI.Active(1); } } // end Shield
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); } }