void DestroyAll()
 {
     _EquipInfoList.Clear();
     _MonsterInfoList.Clear();
     DragonBallRankMgr.GetInstance().DestoryChild();
     Destroy(gameObject);
 }
 public static DragonBallRankMgr GetInstance()
 {
     if (mDragonBallRankMgr == null)
     {
         mDragonBallRankMgr = new DragonBallRankMgr();
     }
     return(mDragonBallRankMgr);
 }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
//        DragonBallRankMgr.GetInstance().InitRankCell(_Grid);
        SetBtnContent(RankBtnType.Five_Formation);
        mView = _Grid.transform.parent.gameObject.GetComponent <UIScrollView>();
        mGrid = _Grid.GetComponent <UIGrid>();

        DragonBallRankMgr.GetInstance().mRoot = _Grid;
    }
Exemple #4
0
 void OnClick()
 {
     if (_IsChoose)
     {
         return;
     }
     DragonBallRankMgr.GetInstance().SetCheckInfoListChoose(_index);
     DragonBallRankMgr.GetInstance().SetChooseDetail(this);
     SetChoose(true);
 }
    private void SetMonsterTeam()
    {
        GetNewFinalTrialRankCheckInfoResponse res = DragonBallRankMgr.GetInstance().m_response;

        if (res.data.detail != null && res.data.detail.monteam != null && res.data.detail.monteam.Length != 0 && res.data.detail.monteam[m_teamindex].mon != null)
        {
            m_MonTeam = new MonsterTeam(1, res.data.detail.monteam[m_teamindex].mon.Count);
        }
        else
        {
            m_MonTeam = new MonsterTeam(1, 1);
        }
        foreach (string keys in res.data.detail.monteam[m_teamindex].mon.Keys)
        {
            int id = 0;
            if (res.data.detail.monteam[m_teamindex].mon.TryGetValue(keys, out id))
            {
                for (int i = 0; i < res.data.detail.monster.Length; i++)
                {
                    if (id == res.data.detail.monster[i].id)
                    {
                        Monster mon = res.data.detail.monster[i].toMonster(Core.Data.monManager);
                        int     pos = int.Parse(keys);
                        pos  = pos % 100;
                        pos -= 1;
                        m_MonTeam.setMember(mon, pos);
                        EquipInfo info = null;
                        if (res.data.detail.equip != null && res.data.detail.equip.Length != 0)
                        {
                            if (m_equipteamindex >= 0)
                            {
                                if (res.data.detail.equip[m_equipteamindex].EquipIdList[pos] != null)
                                {
                                    foreach (int _id in res.data.detail.equip[m_equipteamindex].EquipIdList[pos])
                                    {
                                        for (int t = 0; t < res.data.detail.eqip.Length; t++)
                                        {
                                            if (res.data.detail.eqip[t].id == _id)
                                            {
                                                info = res.data.detail.eqip[t];
                                                EquipData data = Core.Data.EquipManager.getEquipConfig(info.num);
                                                Equipment ment = new Equipment(info, data, Core.Data.gemsManager);
                                                m_MonTeam.setEquip(ment, pos);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        break;
                    }
                }
            }
        }
    }
Exemple #6
0
 void LookQueueClick()
 {
     DragonBallRankMgr.GetInstance().FinalTrialRankCheckInfoRequest((int)gid);
 }
Exemple #7
0
 void Tewele_OnClick()
 {
     SetBtnContent(RankBtnType.Twelve_Formation);
     DragonBallRankMgr.GetInstance().FinalTrialRankRequest(12);
 }
Exemple #8
0
 void Eight_OnClick()
 {
     SetBtnContent(RankBtnType.Eight_Formation);
     DragonBallRankMgr.GetInstance().FinalTrialRankRequest(8);
 }
Exemple #9
0
 void Back_OnClick()
 {
     gameObject.SetActive(false);
     DragonBallRankMgr.GetInstance().DeleteRankCellList();
     Destroy(gameObject);
 }
    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();
    }
 void ZhenRong_OnClick()
 {
     DragonBallRankMgr.GetInstance().FinalTrialRankCheckInfoRequest(EnemyId);
 }
 void SearchRank_OnClick()
 {
     DragonBallRankMgr.GetInstance().SetRankPanel(true);
 }
Exemple #13
0
 void OnClick_ZhenXiing()
 {
     DragonBallRankMgr.GetInstance().FinalTrialRankCheckInfoRequest(_gid);
 }