示例#1
0
    void OnClickMain()
    {
        m_nTempIndex = -1;
        List <Monster> list = new List <Monster>();

        RUIType.EMBoxType type = RUIType.EMBoxType.NONE;
        switch (m_nType)
        {
        case 0:
            type = RUIType.EMBoxType.HECHENG_ZHENREN_MAIN;
            break;

        case 1:
            type = RUIType.EMBoxType.ZHENREN_HE_SHENREN_MAIN;
            break;

        case 2:
            type = RUIType.EMBoxType.HECHENG_SHENREN_MAIN;
            break;
        }

        int stage = RuntimeMonster.NORMAL_MONSTER;

        if (m_nType == 1)
        {
            stage = RuntimeMonster.ZHEN_MONSTER;
        }

        for (int i = 1; i <= 5; i++)
        {
            List <Monster> stageList = Core.Data.monManager.GetMonListByStage(i, stage);
            if (stageList != null && stageList.Count > 0)
            {
                list.AddRange(stageList.ToArray());
            }
        }

        if (list.Count == 0)
        {
//			UIInformation.GetInstance ().SetInformation (Core.Data.stringManager.getString (5095), Core.Data.stringManager.getString (5030), Core.Data.stringManager.getString (5066), OpenZhaoMuUI);
            SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(5095));
            return;
        }
        ClearXX();
        DBUIController.mDBUIInstance.SetViewState(RUIType.EMViewState.S_Bag, type);
        TrainingRoomUI.mInstance.SetShow(false);
    }
示例#2
0
    void OnClickSub(GameObject obj)
    {
        //配卡 不能再当前队伍中
        int index = int.Parse(obj.name);

        if (!RED.IsActive(m_btnSub [index].gameObject) && !RED.IsActive(m_subMons [index].gameObject))
        {
            return;
        }

        if (m_mainData == null)
        {
            SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(5094));
            return;
        }

        m_nTempIndex = index;
        RUIType.EMBoxType type = RUIType.EMBoxType.NONE;
        switch (m_nType)
        {
        case 0:
            type = RUIType.EMBoxType.HECHENG_ZHENREN_SUB;
            break;

        case 1:
            type = RUIType.EMBoxType.ZHENREN_HE_SHENREN_SUB;
            break;

        case 2:
            type = RUIType.EMBoxType.HECHENG_SHENREN_SUB;
            break;
        }

        List <Monster> list = new List <Monster> ();

        switch (type)
        {
        case RUIType.EMBoxType.HECHENG_ZHENREN_SUB:
            for (short i = 6; i > 0; i--)
            {
                List <Monster> temp = Core.Data.monManager.GetZhenRenHeChSubMon(i);
                if (temp != null && temp.Count > 0)
                {
                    list.AddRange(temp.ToArray());
                }

                if (list != null && list.Count > 0)
                {
                    break;
                }
            }
            break;

        case RUIType.EMBoxType.ZHENREN_HE_SHENREN_SUB:
            for (short i = 6; i > 0; i--)
            {
                List <Monster> temp = Core.Data.monManager.GetZhenRenHeShenRenSub(i);

                if (temp != null && temp.Count > 0)
                {
                    list.AddRange(temp.ToArray());
                }
                if (list != null && list.Count > 0)
                {
                    break;
                }
            }
            break;

        case RUIType.EMBoxType.HECHENG_SHENREN_SUB:
            for (short i = 6; i > 0; i--)
            {
                List <Monster> temp = null;
                if (m_subData[index] == null)
                {
                    temp = Core.Data.monManager.GetShenRenHeChSubMon(i);
                }
                else
                {
                    temp = Core.Data.monManager.GetHechengMon(i, m_subData[index].num, m_subData[index].RTData.Attribute);
                    if (temp != null && temp.Count > 0)
                    {
                        for (int m = 0; m < temp.Count; m++)
                        {
                            if (temp[m].pid == m_subData[index].pid)
                            {
                                temp.Remove(temp[m]);
                            }
                        }
                    }
                }

                if (temp != null && temp.Count > 0)
                {
                    list.AddRange(temp.ToArray());
                }
                if (list != null && list.Count > 0)
                {
                    break;
                }
            }
            break;
        }

        if (list == null || list.Count == 0)
        {
//			UIInformation.GetInstance ().SetInformation (Core.Data.stringManager.getString (5095), Core.Data.stringManager.getString (5030), Core.Data.stringManager.getString (5066), OpenZhaoMuUI);
            SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(5095));
        }
        else
        {
            ClearXX();
            DBUIController.mDBUIInstance.SetViewState(RUIType.EMViewState.S_Bag, type);
            TrainingRoomUI.mInstance.SetShow(false);
        }
    }