示例#1
0
    void OnItemClick(ShopUIItem item)
    {
        int index = item.GetIndex();

        if (index == curSelectIndex)
        {
            return;
        }
        curSelectIndex = index;
        if (curSelectItem)
        {
            curSelectItem.SetSelect(false);
        }
        curSelectItem = item;
        curSelectItem.SetSelect(true);
        RefreshProperty();
    }
示例#2
0
    void RefreshChild()
    {
        childMgr.RefreshChildCount(curShopData.ShopItems.Count);
        List <Transform> childList = childMgr.GetUsingTransList();

        for (int i = 0; i < childList.Count; i++)
        {
            Transform    trans      = childList[i];
            Jyx2ShopItem data       = curShopData.ShopItems[i];
            ShopUIItem   uiItem     = trans.GetComponent <ShopUIItem>();
            int          currentNum = GetHasBuyNum(data.Id);
            uiItem.Refresh(data, i, currentNum);
            uiItem.SetSelect(curSelectIndex == i);
            if (curSelectIndex == i)
            {
                curSelectItem = uiItem;
            }
        }
    }