void Update() { fireTimer -= Time.deltaTime; if (fireTimer <= 0 && firing) { Fire(); } if (ammo <= 0) { currentPowerup = PowerupClass.None; } }
public void SetPowerup(PowerupClass newPowerup) { currentPowerup = newPowerup; switch (newPowerup) { case PowerupClass.MachineGun: ammo = 100; break; case PowerupClass.Shotgun: ammo = 15; break; case PowerupClass.Revolver: ammo = 12; break; } }