Exemplo n.º 1
0
    public void InitRankCheckInfo(GameObject mGrid)
    {
        if (m_response == null)
        {
            RED.Log("FinalTrialRankCheckInfoResponse is nulll");
        }
        GameObject obj1   = PrefabLoader.loadFromPack("LS/pbLSRankRole") as GameObject;
        int        length = m_response.data.detail.monteam.Length;

        for (int i = 0; i < length; i++)
        {
            if (obj1 != null)
            {
                GameObject go = NGUITools.AddChild(mGrid, obj1);
                go.gameObject.name = "pbLSRankRole" + i.ToString();
                RankRoleIcon mm = go.gameObject.GetComponent <RankRoleIcon>();
                mRankRoleIcon.Add(mm);

//				mm.SetDetail(m_response.data[i], i);
            }
        }
        mRankRoleIcon[0].SetChoose(true);
        _NowChooseIndex = 0;
    }
Exemplo n.º 2
0
 public void SetChooseDetail(RankRoleIcon _mm)
 {
     mUIDragonBallRankCheckInfo._RankRoleIcon = _mm;
     mUIDragonBallRankCheckInfo.SetChoose();
 }
    public void OnShow(GetNewFinalTrialRankCheckInfoResponse mresponse)
    {
        m_teamindex = 0;
        if (mGrid == null || mView == null)
        {
            FindGrid();
        }
        if (mresponse == null || mresponse.data == null)
        {
            return;
        }
        int index = 0;


        if (mresponse.data.detail != null)
        {
            _EquipInfo = mresponse.data.detail.eqip;
            if (mresponse.data.currTeam > 0)
            {
                foreach (MonsterTeamInfo monsterteaminfo in mresponse.data.detail.monteam)
                {
                    if (monsterteaminfo.teamid == mresponse.data.currTeam)
                    {
                        break;
                    }
                    m_teamindex++;
                }
            }
            for (int z = 0; z < mresponse.data.detail.monteam.Length; z++)
            {
                if (mresponse.data.detail.monteam[z].teamid == mresponse.data.currTeam)
                {
                    teaminfo = mresponse.data.detail.monteam[z];
                    Capacity = Core.Data.playerManager.GetUserLvlInfo(mresponse.data.lv).petSlot;
                }
            }
        }

        m_equipteamindex = -1;
        if (mresponse.data.detail != null && mresponse.data.detail.equip != null)
        {
            for (int i = 0; i < mresponse.data.detail.equip.Length; i++)
            {
                if (mresponse.data.detail.equip[i].id == mresponse.data.currTeam)
                {
                    m_equipteamindex = i;
                    mresponse.data.detail.equip[m_equipteamindex].HumanReadable();
                    break;
                }
            }
        }



        GameObject obj1 = PrefabLoader.loadFromPack("LS/pbLSRankRole") as GameObject;

        SortedDictionary <string, int> dic = new SortedDictionary <string, int>();

        foreach (string key in teaminfo.mon.Keys)
        {
            dic.Add(key, teaminfo.mon[key]);
        }

        teaminfoTemp        = new MonsterTeamInfo();
        teaminfoTemp.teamid = teaminfo.teamid;
        teaminfoTemp.mon    = new Dictionary <string, int>();
        foreach (string keys in dic.Keys)
        {
            for (int i = 0; i < mresponse.data.detail.monster.Length; i++)
            {
                int id = 0;
                if (dic.TryGetValue(keys, out id))
                {
                    if (mresponse.data.detail.monster[i].id == id)
                    {
                        _MonsterInfoList.Add(mresponse.data.detail.monster[i]);
                        teaminfoTemp.mon.Add(keys, mresponse.data.detail.monster[i].num);
                        if (obj1 != null)
                        {
                            GameObject go = NGUITools.AddChild(mGrid.gameObject, obj1);

                            //						go.gameObject.name = (1000 + i).ToString();
                            RankRoleIcon mm = go.gameObject.GetComponent <RankRoleIcon>();
                            DragonBallRankMgr.GetInstance().mRankRoleIcon.Add(mm);
                            mm.gameObject.SetActive(true);

                            Monster mon = mresponse.data.detail.monster[i].toMonster(Core.Data.monManager);

                            if (mresponse.data.detail.equip != null && m_equipteamindex >= 0)
                            {
                                mm.InitUI(mon, index, mresponse.data.detail.equip[m_equipteamindex].EquipIdList[index], mresponse.data.detail.monteam);
                            }
                            else
                            {
                                mm.InitUI(mon, index, new int[] {}, mresponse.data.detail.monteam);
                            }
                            break;
                        }
                    }
                }
            }
            index++;
        }

        _RankRoleIcon = DragonBallRankMgr.GetInstance().mRankRoleIcon[0];
        _RankRoleIcon.SetChoose(true);
        DragonBallRankMgr.GetInstance()._NowChooseIndex = 0;

        SetChoose();

        //自己组装monsterteam 用于打开缘界面做准备
        SetMonsterTeam();

        mGrid.Reposition();
        mView.ResetPosition();
    }