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; }
public void TryBuy() { bool canBuy = _itemScroller.CanBuy(); OnBuy(canBuy); if (canBuy) { StartCoroutine(ExitShopping()); } }