Пример #1
0
 public void BuyShield()
 {
     if (playerRef.SafeBuy(cost))
     {
         playerHealth.HasShield = true;
     }
 }
Пример #2
0
 public void BuyJetpack()
 {
     if (playerRef.SafeBuy(cost))
     {
         playerJetpack.hasJetpack = true;
     }
 }
Пример #3
0
    public void BuyWeapon(Weapon weaponToBuy)
    {
        switch (weaponToBuy)
        {
        case Weapon.Pistol:
        {
            Debug.LogError("Se intento comprar pistol");
            break;
        }

        case Weapon.Shotgun:
        {
            if (playerMoney.SafeBuy(shotgun_cost))
            {
                shotgun_unlocked = true;
                SavePrefs();
            }
            break;
        }

        case Weapon.BurstRifle:
        {
            if (playerMoney.SafeBuy(rifle_cost))
            {
                rifle_unlocked = true;
                SavePrefs();
            }
            break;
        }

        case Weapon.RocketLauncher:
        {
            if (playerMoney.SafeBuy(rpg_cost))
            {
                rpg_unlocked = true;
                SavePrefs();
            }
            break;
        }
        }
    }