Ejemplo n.º 1
0
    public void ClickArrow()
    {
        bool canSpend = Avatar.Instance.CanSpendCoins(ARROW_COST);
        int  index    = AmmoBeltView.Instance.FindNextOpenIndex();

        if (canSpend && index > -1)
        {
            _index = index;
            YesNoAlert.Present("Balloon Arrow", "Are you sure you want to purchase this?", BuyArrow, null);
        }
        else
        {
            if (!canSpend)
            {
                DefaultAlert.Present("Sorry", "You don't have enough coins", null, null, false, "OK");
            }
            else
            {
                DefaultAlert.Present("Sorry", "Your ammo bandelier is full", null, null, false, "OK");
            }
        }
    }
Ejemplo n.º 2
0
    public void Action()
    {
        StoreItem storeItem = _currentItem.Object as StoreItem;

        if (storeItem.Purchased)
        {
            if (!storeItem.Equipped)
            {
                StartCoroutine(StartEquip(storeItem));
            }
            else
            {
                StartCoroutine(StartUnequip(storeItem));
            }
        }
        else
        {
            bool canSpendCoins = Avatar.Instance.CanSpendCoins(storeItem.Coins);
            bool canSpendGems  = Avatar.Instance.CanSpendGems(storeItem.Gems);

            if (canSpendCoins && canSpendGems)
            {
                YesNoAlert.Present("Gear", "Are you sure you want to purchase this?", BuyGear, null);
            }
            else
            {
                if (!canSpendCoins)
                {
                    DefaultAlert.Present(SORRY, INSUFFICIENT_COINS);
                }
                else
                {
                    DefaultAlert.Present(SORRY, INSUFFICIENT_GEMS);
                }
            }
        }
    }