Beispiel #1
0
    void InitStoreItem(StoreInfo info, C2G.StoreLimitInfoGetAck ack)
    {
        m_BottomToggle.value = true;
        Array.ForEach(m_Grid.GetComponentsInChildren(typeof(StoreItem), true), i => DestroyImmediate(i.gameObject));
        for (int i = 0; i < info.m_GoodsItem.Count; ++i)
        {
            StoreItem         item       = NGUITools.AddChild(m_Grid.gameObject, StoreItemPrefab).GetComponent <StoreItem>();
            pd_StoreLimitInfo limit_info = null;
            if (ack.infos != null)
            {
                limit_info = ack.infos.Find(e => e.item_id == info.m_GoodsItem[i].ID);
            }

            item.Init(info.m_GoodsItem[i], limit_info);
        }
        m_Grid.Reposition();

        UIScrollView scroll = m_Grid.GetComponentInParent <UIScrollView>();

        if (scroll != null)
        {
            scroll.ResetPosition();
        }
        UpdateBottomDesc();
    }
Beispiel #2
0
 void OnStoreLimitInfoGet(C2G.StoreLimitInfoGet packet, C2G.StoreLimitInfoGetAck ack)
 {
     InitStoreItem(CurrentStoreInfo, ack);
 }