Ejemplo n.º 1
0
    public void Select(ShopItem selectedShopItem)
    {
        if (_actualShopItem == selectedShopItem)
        {
            return;
        }
        _actualShopItem = selectedShopItem;

        int rarenessID = (int)selectedShopItem.rareness;

        StartCoroutine(ChangeBackgroundColor(backgroundAColors[rarenessID], backgroundBColors[rarenessID]));

        nameText.text = selectedShopItem.name;

        if (_itemScroller.CanBuy())
        {
            priceText.color = Color.green;
        }
        else
        {
            priceText.color = Color.red;
        }

        priceText.text = _itemScroller.userCurrency.points + " / $" + selectedShopItem.price;
    }
Ejemplo n.º 2
0
    public void TryBuy()
    {
        bool canBuy = _itemScroller.CanBuy();

        OnBuy(canBuy);
        if (canBuy)
        {
            StartCoroutine(ExitShopping());
        }
    }