Ejemplo n.º 1
0
    private void CreateAllItemsList()
    {
        m_iNumCount = 0;
        for (int i = 0; i < m_listAllTypeInfo.Count; i++)
        {
            ItemTypeInfo item = m_listAllTypeInfo[i];
            if (item.Num < 1)
            {
                continue;
            }
            GameObject go = NGUITools.AddChild(MyHead.Parent, MyHead.BeiBaoItem);
            if (go)
            {
                BeiBaoItem beiBaoItem = go.GetComponent <BeiBaoItem>();
                if (beiBaoItem)
                {
                    beiBaoItem.SetData(item, item.Num, this);
                    //                     NGUIUtil.SetItemPanelDepth(go, MyHead.Parent.transform.parent.gameObject);
                }
                if (m_iNumCount == 0 && nSelectIndex == -1)
                {
                    nSelectIndex = i;
                    beiBaoItem.MyHead.TogSelect.value = true;
                }
                else if (nSelectIndex == i)
                {
                    beiBaoItem.MyHead.TogSelect.value = true;
                }
            }

            m_iNumCount++;
        }
    }
Ejemplo n.º 2
0
    private void CreateItem(s_itemtypeInfo info, int num)
    {
        GameObject go = NDLoad.LoadWndItem("BeiBaoItem", MyHead.TabItem.transform);

        if (go)
        {
            BeiBaoItem item = go.GetComponent <BeiBaoItem>();
            if (item != null)
            {
                item.SetData(ItemM.GetItemInfo(info), num, null);
            }
        }
        MyHead.TabItem.Reposition();
    }