// Update is called once per frame
 void FixedUpdate()
 {
     if (powerUpActive && Time.time < activeUntilTime)
     {
         if (powerUpType == "multishot")
         {
             multishotScript.ShootRepeating();
         }
         else if (powerUpType == "laser")
         {
             laser.SetActive(true);
         }
         else if (powerUpType == "berserk")
         {
             berserkAura.SetActive(true);
         }
     }
     else
     {
         DeactivatePowerUp();
     }
 }
Beispiel #2
0
    void FixedUpdate()
    {
        if (isPowerUpActive && Time.time < activeUntilTime)
        {
            if (powerUpType == "multishot")
            {
                if (Input.GetKey(KeyCode.Space))
                {
                    ammoController.shootingAllowed = false;
                    multishot.ShootRepeating();
                }
            }
            else if (powerUpType == "laser")
            {
                ammoController.shootingAllowed = false;
                laser.SetActive(true);
            }
            else if (powerUpType == "berserk")
            {
                berserkAura.SetActive(true);
            }
        }
        else
        {
            if (laser.activeInHierarchy)
            {
                laser.SetActive(false);
            }
            else if (berserkAura.activeInHierarchy)
            {
                berserkAura.SetActive(false);
            }

            powerUpType     = null;
            isPowerUpActive = false;
            ammoController.shootingAllowed = true;
        }
    }