Exemplo n.º 1
0
    public void Show(int id, int count)
    {
        _id = id;
        var item = GetItem();

        m_NameText.text  = item.Name;
        m_CountText.text = (count > 1 ? count.ToString() : "");

        Jyx2ResourceHelper.GetItemSprite(id, m_Image);
    }
Exemplo n.º 2
0
    public void Refresh(Jyx2ShopItem shopItem, int index, int hasBuyNum)
    {
        this.index    = index;
        this.shopItem = shopItem;
        Jyx2Item item = ConfigTable.Get <Jyx2Item>(shopItem.Id);

        if (item == null)
        {
            GameUtil.LogError("查询不到物品配置,id =" + shopItem.Id);
            return;
        }
        Jyx2ResourceHelper.GetItemSprite(int.Parse(item.Id), iconImg);
        desText.text = $"{item.Name}\n价格:{shopItem.Price}";
        leftNum      = shopItem.Count - hasBuyNum;
        leftNum      = Tools.Limit(leftNum, 0, shopItem.Count);
        itemNum.text = leftNum.ToString();
    }