Пример #1
0
    public void IncreaseQuantity(BuyableItems item)
    {
        switch (item)
        {
        case BuyableItems.Potion:
            potionQty++;
            break;

        case BuyableItems.Armour:
            if (totalArmourBought + armourQty + 1 <= maxArmourAvailable)
            {
                armourQty++;
            }
            break;

        case BuyableItems.Attack:
            if (totalAttackBought + attackQty + 1 <= maxAttackAvailable)
            {
                attackQty++;
            }
            break;

        case BuyableItems.Ally:
            if (GetNumberAllies() + allyQty + 1 <= maxAlliesAlive)
            {
                allyQty++;
            }
            break;
        }
        warning.SetActive(false);
        SetQuantitiesTexts();
        CalculateTotal();
    }
Пример #2
0
    public void DecreaseQuantity(BuyableItems item)
    {
        switch (item)
        {
        case BuyableItems.Potion:
            if (potionQty > 0)
            {
                potionQty--;
            }
            break;

        case BuyableItems.Armour:
            if (armourQty > 0)
            {
                armourQty--;
            }
            break;

        case BuyableItems.Attack:
            if (attackQty > 0)
            {
                attackQty--;
            }
            break;

        case BuyableItems.Ally:
            if (allyQty > 0)
            {
                allyQty--;
            }
            break;
        }
        warning.SetActive(false);
        SetQuantitiesTexts();
        CalculateTotal();
    }