示例#1
0
    void UpdateBelleMatrixItems()
    {
        // 加载阵型Item
        if (null == m_ObjBelleMatrixItem)
        {
            LogModule.ErrorLog("can not load belle matrix item prefab in m_ObjBelleMatrixItem:");
            return;
        }

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

        if (null == mainPlayer)
        {
            return;
        }
        for (int i = 0; i < TableManager.GetBelleMatrix().Count; i++)
        {
            Tab_BelleMatrix curBelleMatrix = TableManager.GetBelleMatrixByID(i, 0);
            if (null == curBelleMatrix)
            {
                continue;
            }

            GameObject curItem = Utils.BindObjToParent(m_ObjBelleMatrixItem, MatrixListGrid);
            if (null != curItem && null != curItem.GetComponent <BelleMatrixItem>())
            {
                curItem.GetComponent <BelleMatrixItem>().SetData(this, i, curBelleMatrix);
            }
        }
        MatrixListGrid.GetComponent <UIGrid>().repositionNow = true;

        // 显示第一个阵型信息
        Transform curMatrixItem = MatrixListGrid.transform.FindChild("0");

        if (null != curMatrixItem)
        {
            m_curSelectMatrix = curMatrixItem.GetComponent <BelleMatrixItem>();
            if (null != m_curSelectMatrix)
            {
                m_curSelectMatrix.EnableHightLight(true);
            }

            MatrixInfo.SetActive(true);
            ShowMatrixByItem();
        }
        else
        {
            MatrixInfo.SetActive(false);
        }
    }
示例#2
0
    //     public void ShowMyBeleList()
    //     {
    //         m_MyBelleWindow.Show();
    //     }
    //     void OnCloseBelleListPopWindowClick()
    //     {
    //         m_MyBelleWindow.Hide();
    //     }

    // 选择一个阵型
    public void OnMatrixListItemClick(GameObject objItem)
    {
        if (null != m_curSelectMatrix)
        {
            m_curSelectMatrix.EnableHightLight(false);
        }

        m_curSelectMatrix = objItem.GetComponent <BelleMatrixItem>();
        if (null != m_curSelectMatrix)
        {
            m_curSelectMatrix.EnableHightLight(true);
        }

        ShowMatrixByItem();
    }