Ejemplo n.º 1
0
 public MainCopy(Int32 id)
 {
     copyId    = id;
     startTime = -1;
     clostTime = -1;
     tblCopy   = TableManager.GetCopyByID(id);
     copyState = CopyState.UNOPEN;
     subCopys  = new List <SubCopy>();
     listOrder = -1;
     for (int i = 0; i < 15; i++)
     {
         if (tblCopy.GetSubcopybyIndex(i) != -1)
         {
             SubCopy sub_copy = new SubCopy(tblCopy.GetSubcopybyIndex(i));
             subCopys.Add(sub_copy);
         }
     }
 }
    public void ReturnToPVEBossList()
    {
        Debug.Log("xlym: FriendShipSettleController return to ReturnToPVEBossList");
        //这里新手引导中必须返回主界面
        if (!GuideManager.Instance.isEnd())
        {
            if (GuideManager.Instance.currentStep == GuideManager.GUIDE_STEP.COPY1_3_END)
            {
                GuideManager.Instance.FinishedStep(GuideManager.GUIDE_STEP.COPY1_3_END);
                ReturnToMainUI();
                return;
            }
            else if (GuideManager.Instance.currentStep != GuideManager.GUIDE_STEP.COPY1_3)
            {
                ReturnToMainUI();
                return;
            }
            else if (GuideManager.Instance.currentStep == GuideManager.GUIDE_STEP.COPY1_3)
            {
                //不做处理,跳转至pve列表
            }
        }
        if (Obj_MyselfPlayer.GetMe().battleData.isWin)
        {
            GameObject.FindWithTag("main_controller").SendMessage("showBottomBar");

            if (Obj_MyselfPlayer.GetMe().isLastBattleNotFinish)
            {
                mainLogic.SendMessage("LoadPveSceneList");
                return;
            }
            int nextSubCopy = Obj_MyselfPlayer.GetMe().curSubcopy.subCopyID + 1;
            Debug.Log("NextCopyID : " + nextSubCopy);
            List <SubCopy> subCopys = Obj_MyselfPlayer.GetMe().normalCopys;
            Debug.Log("GetMe().normalCopys.Count = " + subCopys.Count);
            bool isMainCopyOpen = true;
            foreach (SubCopy sub in subCopys)
            {
                if (sub.subCopyID == nextSubCopy)
                {
                    isMainCopyOpen = false;
                }
            }
            Tab_Copydetail nextSubDetail = TableManager.GetCopydetailByID(nextSubCopy);
            if (nextSubDetail == null) //如果获取下一副本不存在,要返回当前大副本小副本列表 可能发生在最后一个小副本
            {
                Debug.Log("No Next Copy [NextCopyDetail is Null]");
                mainLogic.SendMessage("LoadPveBossList");
                return;
            }
            Debug.Log("GetMe().curSubcopy.tblCopyDetail.Copyfather = " + Obj_MyselfPlayer.GetMe().curSubcopy.tblCopyDetail.Copyfather);
            if (nextSubDetail.Copyfather == Obj_MyselfPlayer.GetMe().curSubcopy.tblCopyDetail.Copyfather)
            {
                isMainCopyOpen = false;
            }
            if (!isMainCopyOpen) //没有大副本开启
            {
                Debug.Log("No Main Copy New Open");
                mainLogic.SendMessage("LoadPveBossList");
            }
            else
            {
                Tab_Copy nextMainCopy = TableManager.GetCopyByID(nextSubDetail.Copyfather);
                if (Obj_MyselfPlayer.GetMe().level >= nextMainCopy.PlayerLevel) //等级足够进入新大副本
                {
                    Debug.Log("Level is OK For New Main Copy -> UserLevel : " + Obj_MyselfPlayer.GetMe().level + " Need : " + nextMainCopy.PlayerLevel);
                    Debug.Log("GetMe().normalMainCopys.Count = " + Obj_MyselfPlayer.GetMe().normalMainCopys.Count);
                    foreach (MainCopy mainCopy in Obj_MyselfPlayer.GetMe().normalMainCopys)
                    {
                        if (mainCopy.copyId == nextSubDetail.Copyfather)
                        {
                            if (Obj_MyselfPlayer.GetMe().isNextMainOpened)
                            {
                                Debug.Log("NextMainOpened");
                                mainLogic.SendMessage("LoadPveBossList");//非首次打开 返回当前大副本小副本列表
                                return;
                            }
                            else if (mainCopy.copyId == 2) //如果是第二个大副本,并且是首次打开
                            {
                                Debug.Log("No.2 Main New Open");
                                if (GuideManager.Instance.currentStep == GuideManager.GUIDE_STEP.GIFT)
                                {
                                    GuideManager.Instance.isInSubStep = false;
                                }
                                mainLogic.SendMessage("ReturnToMainUI"); //首次打开第二大副本 返回主界面
                                return;
                            }
                            else
                            {
                                Obj_MyselfPlayer.GetMe().curMainCopy = mainCopy; //首次打开其他大副本-跳转到新开启大副本的小副本列表
                            }
                            break;
                        }
                    }
                }
                Debug.Log("Level < Request || Other Main Copy New Open");
                mainLogic.SendMessage("LoadPveBossList");
            }
        }
        else
        {
            mainLogic.SendMessage("onBattleFailWindow");
        }
        //		GameObject.FindWithTag("main_controller").SendMessage("showBottomBar");
        //		mainLogic.SendMessage("LoadPveBossList");
    }
Ejemplo n.º 3
0
    void Start()
    {
        logicTarget = GameObject.Find("MainUILogic");
        InitCopys();

        Obj_MyselfPlayer.GetMe().UpdateCopyList(CopyType.NORMAL);
        normalCopys = Obj_MyselfPlayer.GetMe().normalMainCopys;
        CreateCopyList(CopyType.NORMAL);
        Obj_MyselfPlayer.GetMe().UpdateCopyList(CopyType.ACTIVITY);
        activityCopys = Obj_MyselfPlayer.GetMe().activityMainCopys;
        CreateCopyList(CopyType.ACTIVITY);
        EnalbleCopy(Obj_MyselfPlayer.GetMe().copyType);

        if (Obj_MyselfPlayer.GetMe().isLastBattleNotFinish)  //如果是战斗中断返回的那场战斗,需要以下代码处理跳转
        {
            Obj_MyselfPlayer.GetMe().isLastBattleNotFinish = false;
            int curMainCopyID = Obj_MyselfPlayer.GetMe().curSubcopy.tblCopyDetail.Copyfather; //中断的战斗的大副本ID
            curMainCopyID--;                                                                  //在List里从0开始,因此CopyID需要减1

            int nextSubCopy = Obj_MyselfPlayer.GetMe().curSubcopy.subCopyID + 1;
            Debug.Log("NextCopyID : " + nextSubCopy);
            List <SubCopy> subCopys       = Obj_MyselfPlayer.GetMe().normalCopys;
            bool           isMainCopyOpen = true;
            foreach (SubCopy sub in subCopys)
            {
                if (sub.subCopyID == nextSubCopy)
                {
                    isMainCopyOpen = false;
                }
            }
            Tab_Copydetail nextSubDetail = TableManager.GetCopydetailByID(nextSubCopy);
            if (nextSubDetail == null) //如果获取下一副本不存在,要返回当前大副本小副本列表 可能发生在最后一个小副本
            {
                Debug.Log("No Next Copy [NextCopyDetail is Null]");
                GameObject go = this.transform.FindChild("PanelList/GridNormal/" + curMainCopyID.ToString()).gameObject;
                if (go != null)
                {
                    OnSelectMainCopy(go);
                }
                return;
            }
            Debug.Log("GetMe().curSubcopy.tblCopyDetail.Copyfather = " + Obj_MyselfPlayer.GetMe().curSubcopy.tblCopyDetail.Copyfather);
            if (nextSubDetail.Copyfather == Obj_MyselfPlayer.GetMe().curSubcopy.tblCopyDetail.Copyfather)
            {
                isMainCopyOpen = false;
            }
            if (!isMainCopyOpen) //没有大副本开启
            {
                Debug.Log("No Main Copy New Open");
                GameObject go = this.transform.FindChild("PanelList/GridNormal/" + curMainCopyID.ToString()).gameObject;
                if (go != null)
                {
                    OnSelectMainCopy(go);
                }
            }
            else
            {
                Tab_Copy nextMainCopy = TableManager.GetCopyByID(nextSubDetail.Copyfather);
                if (Obj_MyselfPlayer.GetMe().level >= nextMainCopy.PlayerLevel) //等级足够进入新大副本
                {
                    Debug.Log("Level is OK For New Main Copy -> UserLevel : " + Obj_MyselfPlayer.GetMe().level + " Need : " + nextMainCopy.PlayerLevel);
                    Debug.Log("GetMe().normalMainCopys.Count = " + Obj_MyselfPlayer.GetMe().normalMainCopys.Count);
                    foreach (MainCopy mainCopy in Obj_MyselfPlayer.GetMe().normalMainCopys)
                    {
                        if (mainCopy.copyId == nextSubDetail.Copyfather)
                        {
                            if (Obj_MyselfPlayer.GetMe().isNextMainOpened)
                            {
                                Debug.Log("NextMainOpened");
                                GameObject goCopy = this.transform.FindChild("PanelList/GridNormal/" + curMainCopyID.ToString()).gameObject;
                                if (goCopy != null)
                                {
                                    OnSelectMainCopy(goCopy);
                                }
                                return;
                            }
                            else if (mainCopy.copyId == 2) //如果是第二个大副本,并且是首次打开
                            {
                                Debug.Log("No.2 Main New Open");
                                if (GuideManager.Instance.currentStep == GuideManager.GUIDE_STEP.GIFT)
                                {
                                    GuideManager.Instance.isInSubStep = false;
                                }
                                logicTarget.SendMessage("ReturnToMainUI"); //首次打开第二大副本 返回主界面
                                return;
                            }
                            else
                            {
                                curMainCopyID++;
                            }
                            break;
                        }
                    }
                }
                Debug.Log("Level < Request || Other Main Copy New Open");
                Transform go = this.transform.FindChild("PanelList/GridNormal/" + curMainCopyID.ToString());
                if (go != null)
                {
                    OnSelectMainCopy(go.gameObject);
                }
            }
        }
    }