示例#1
0
    void UpDateUI(int nShopTabID)
    {
        Tab_GongJiShop ShopTab = TableManager.GetGongJiShopByID(nShopTabID, 0);

        if (ShopTab == null)
        {
            return;
        }

        Price        = ShopTab.Price;
        ConsumItemID = ShopTab.ConsumItemID;

        Tab_CommonItem ShopItem = TableManager.GetCommonItemByID(ShopTab.ItemID, 0);

        if (ShopItem == null)
        {
            return;
        }

        m_ItemSlot.InitInfo(ItemSlotLogic.SLOT_TYPE.TYPE_ITEM, ShopTab.ItemID, ItemOnClick);

        if (null != m_NameLabel)
        {
            m_NameLabel.text = ShopItem.Name;
        }
    }
示例#2
0
    // 更新列表
    public void UpdateShopList()
    {
        Utils.CleanGrid(m_ListGrid.gameObject);

        Obj_MainPlayer MainPlayer = Singleton <ObjManager> .Instance.MainPlayer;

        if (MainPlayer == null)
        {
            return;
        }

        foreach (KeyValuePair <int, List <Tab_GongJiShop> > pair in TableManager.GetGongJiShop())
        {
            Tab_GongJiShop tabShopItem = pair.Value[0];

            // 空的
            if (tabShopItem == null)
            {
                continue;
            }

            // 职业是否
            if (tabShopItem.ProfessID != GlobeVar.INVALID_ID && tabShopItem.ProfessID != MainPlayer.Profession)
            {
                continue;
            }

            // 创建 红包
            GameObject gShopItem = Utils.BindObjToParent(m_GongJiItem.gameObject, m_ListGrid.gameObject, tabShopItem.Id.ToString());
            if (null != gShopItem)
            {
                GongJiShopItem ShopItem = gShopItem.GetComponent <GongJiShopItem>();
                if (null != ShopItem)
                {
                    ShopItem.Init(tabShopItem.Id);
                }
            }
        }

        m_ListGrid.Reposition(true);
    }