Exemplo n.º 1
0
    void ScoreAwardList()
    {
        if (TableManager.GetSongHuaAwardInfo() == null)
        {
            return;
        }

        int nTabCount = TableManager.GetSongHuaAwardInfo().Count;

        for (int i = 1; i < nTabCount; i++)
        {
            Tab_SongHuaAwardInfo AwardInfo = TableManager.GetSongHuaAwardInfoByID(i, 0);
            if (AwardInfo == null)
            {
                return;
            }
            GameObject gScoreItem = Utils.BindObjToParent(m_ScoreAwardItemCache.gameObject, m_SongHuaAwardList.gameObject, i.ToString());
            if (null != gScoreItem)
            {
                ScoreAwardItem ScoreItem = gScoreItem.GetComponent <ScoreAwardItem>();
                if (null != ScoreItem)
                {
                    ScoreItem.Init(AwardInfo);
                }
            }
        }

        m_SongHuaAwardList.Reposition(true);

        if (TableManager.GetShouHuaAwardInfo() == null)
        {
            return;
        }

        int nTabCount1 = TableManager.GetShouHuaAwardInfo().Count;

        for (int i = 1; i < nTabCount1; i++)
        {
            Tab_ShouHuaAwardInfo AwardInfo = TableManager.GetShouHuaAwardInfoByID(i, 0);
            if (AwardInfo == null)
            {
                return;
            }
            GameObject gScoreItem = Utils.BindObjToParent(m_ScoreAwardItemCache.gameObject, m_ShouHuaAwardList.gameObject, i.ToString());
            if (null != gScoreItem)
            {
                ScoreAwardItem ScoreItem = gScoreItem.GetComponent <ScoreAwardItem>();
                if (null != ScoreItem)
                {
                    ScoreItem.Init(AwardInfo);
                }
            }
        }

        m_ShouHuaAwardList.Reposition(true);
    }
Exemplo n.º 2
0
    public void Init(Tab_ShouHuaAwardInfo tab)
    {
        if (tab == null)
        {
            return;
        }

        for (int i = 0; i < tab.getItemDataIDCount(); i++)
        {
            if (i >= MAX_NUM_ITEM || i >= m_AwardList.Length)
            {
                return;
            }

            m_RankPosLabel.text = tab.RankPosHigh.ToString();
            if (tab.RankPosHigh < tab.RankPosLow)
            {
                m_RankPosLabel.text += "-" + tab.RankPosLow;
            }

            int            nItemID    = tab.GetItemDataIDbyIndex(i);
            int            nItemCount = tab.GetItemCountbyIndex(i);
            Tab_CommonItem item       = TableManager.GetCommonItemByID(nItemID, 0);
            if (nItemCount > 0 && item != null)
            {
                m_AwardList[i].InitInfo_Item(nItemID, ItemSlotLogic.OnClickOpenTips, nItemCount.ToString(), true);
            }
            else
            {
                m_AwardList[i].gameObject.SetActive(false);
            }
            m_AwardList[i].gameObject.name = i.ToString();
        }
        m_ItemGrid.sorted = true;
        m_ItemGrid.Reposition(true);
    }