Exemplo n.º 1
0
        public void PrintItemsNameAndPrice()
        {
            for (int i = 0; i < _itemNamesToDisplay.Length; i++)
            {
                if (_itemsInStock.GetItemById(i) == null) continue;

                _itemNamesToDisplay[i].text = _itemsInStock.GetItemById(i).ItemName;
                _itemPricesToDisplay[i].text = $"{_itemsInStock.GetItemById(i).ItemPrice}G";
            }
        }
Exemplo n.º 2
0
        public void TryBuyItem()
        {
            if (_currentSelectedItemId == null || GameEventsHandler.Instance.IsBuyingBlocked)
            {
                return;
            }

            var selectedItem = _itemsInStock.GetItemById(_currentSelectedItemId);

            TryConsumePlayerDiamonds(selectedItem);
        }