コード例 #1
0
ファイル: BeiBaoWnd.cs プロジェクト: 741645596/batgame
    private void AddIntorductUI(int iSelectIndex)
    {
        if (iSelectIndex < 0 || iSelectIndex >= m_listAllTypeInfo.Count)
        {
            return;
        }

        ItemTypeInfo info = m_listAllTypeInfo[iSelectIndex];
        GameObject   go   = NDLoad.LoadWndItem("BeiBaoItemIntorduct", MyHead.ItemParent.transform);

        if (go != null)
        {
            BeiBaoItemIntorduct item = go.GetComponent <BeiBaoItemIntorduct>();
            if (item != null)
            {
                item.SetData(info, this);
            }
        }
    }
コード例 #2
0
ファイル: BeiBaoWnd.cs プロジェクト: 741645596/batgame
    private void RefreshIntorduct(ItemTypeInfo info)
    {
        if (info == null)
        {
            return;
        }

        BeiBaoItemIntorduct item = gameObject.GetComponentInChildren <BeiBaoItemIntorduct>();

        if (item != null)
        {
            item.SetData(info, this);
            item.RefreshUI();
        }
        else
        {
            int index = m_listAllTypeInfo.IndexOf(info);
            if (index >= 0 && index < m_listAllTypeInfo.Count)
            {
                AddIntorductUI(index);
            }
        }
    }