public void Init(int nGoodIndex, int nGoodId, int nLeftCount)
    {
        Tab_GuildShop tabShopItem = TableManager.GetGuildShopByID(nGoodId, 0);

        if (tabShopItem == null)
        {
            return;
        }

        Tab_CommonItem tabItem = TableManager.GetCommonItemByID(tabShopItem.ItemID, 0);

        if (tabItem == null)
        {
            return;
        }

        m_ItemSlot.InitInfo_Item(tabShopItem.ItemID, ItemSlotLogic.OnClickOpenTips, tabShopItem.StackSize > 1 ? tabShopItem.StackSize.ToString() : "", tabShopItem.StackSize > 1);
        m_NumContent.text   = nLeftCount <= 0 ? "[FF0000]" + nLeftCount.ToString() : nLeftCount.ToString();
        m_PriceContent.text = tabShopItem.Price.ToString();
        m_NameLabel.text    = tabItem.Name;

        m_GoodsIndex = nGoodIndex;
        m_GoodsId    = nGoodId;
        m_ItemID     = tabItem.Id;
        m_LeftCount  = nLeftCount;
        m_nPrice     = tabShopItem.Price;
    }
    public void Init(Tab_GuildShop tabShopItem)
    {
        if (tabShopItem == null)
        {
            return;
        }

        m_ItemSlot.InitInfo_Item(
            tabShopItem.ItemID,
            ItemSlotLogic.OnClickOpenTips,
            tabShopItem.StackSize > 1 ? tabShopItem.StackSize.ToString() : "",
            tabShopItem.StackSize > 1);
    }
示例#3
0
    void UpdateShopPreviewItem(int level)
    {
        Utils.CleanGrid(m_GuildShopPreviewItemGrid);

        foreach (KeyValuePair <int, List <Tab_GuildShop> > pair in TableManager.GetGuildShop())
        {
            Tab_GuildShop tabShopItem = pair.Value[0];
            if (tabShopItem == null)
            {
                continue;
            }

            if (level < tabShopItem.OpenLevel)
            {
                continue;
            }

            GameObject ShopPreviewItem = Utils.BindObjToParent(m_GuildShopPreviewItem, m_GuildShopPreviewItemGrid, tabShopItem.Id.ToString());
            if (ShopPreviewItem == null || ShopPreviewItem.GetComponent <GuildShopPreviewItem>() == null)
            {
                continue;
            }

            ShopPreviewItem.GetComponent <GuildShopPreviewItem>().Init(tabShopItem);
        }

        if (m_GuildShopPreviewItemGrid.GetComponent <UIGrid>() != null)
        {
            m_GuildShopPreviewItemGrid.GetComponent <UIGrid>().Reposition(true);
        }

        if (m_GuildShopPreviewItemGrid.GetComponent <UITopGrid>() != null)
        {
            m_GuildShopPreviewItemGrid.GetComponent <UITopGrid>().Recenter(true);
        }

        m_ShopBuildTitleLabel.text = StrDictionary.GetClientDictionaryString("#{10484}", level);
        m_ShopBuildSlotLabel.text  = StrDictionary.GetClientDictionaryString("#{10487}", level < 5 ? 6 : 12);
    }