Пример #1
0
 void Update()
 {
     fireTimer -= Time.deltaTime;
     if (fireTimer <= 0 && firing)
     {
         Fire();
     }
     if (ammo <= 0)
     {
         currentPowerup = PowerupClass.None;
     }
 }
Пример #2
0
    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;
        }
    }