void OnClick() { if (gameObject.name == "TabPlayList") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd lapBossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (lapBossWnd) { lapBossWnd.SetShowPanelType(1); lapBossWnd.OnHideBossUI(); } sdActGameMsg.Send_CS_GET_ABYSS_OPEN_LIST_REQ(); } } else if (gameObject.name == "TabLockList") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd lapBossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (lapBossWnd) { lapBossWnd.SetShowPanelType(2); lapBossWnd.OnHideBossUI(); } sdActGameMsg.Send_CS_GET_ABYSS_TRIGGER_LIST_REQ(); } } else if (gameObject.name == "TabLogList") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd lapBossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (lapBossWnd) { lapBossWnd.SetShowPanelType(3); lapBossWnd.OnHideBossUI(); } sdActGameMsg.Send_CS_GET_ABYSS_OPEN_REC_REQ(); } } else if (gameObject.name == "TabDesc") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd lapBossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (lapBossWnd) { lapBossWnd.SetShowPanelType(4); lapBossWnd.OnHideBossUI(); } } } else if (gameObject.name == "wndClose") { if (sdActGameControl.m_UILapBossWnd != null) { sdActGameControl.Instance.CloseGameWnd(sdActGameControl.m_UILapBossWnd); } } else if (gameObject.name == "btnEnter") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd bossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (bossWnd) { if (bossWnd.m_SelectUUID == UInt64.MaxValue) { sdUICharacter.Instance.ShowOkMsg("请选择合适的深渊", null); } else { SAbyssLockInfo info = sdActGameMgr.Instance.GetEnterInfo(bossWnd.m_SelectUUID); if (info != null) { int iTmpID = (int)info.m_ActTmpId; string strLevelID = sdConfDataMgr.Instance().GetLapBossTemplateValueByStringKey(iTmpID, "AbyssLevelID"); int iLevelID = int.Parse(strLevelID); bool bSelf = false; //string strName = sdGameLevel.instance.mainChar.GetProperty()["Name"].ToString(); UInt64 uuMyID = UInt64.Parse(sdGameLevel.instance.mainChar.GetProperty()["DBID"].ToString()); if (uuMyID == info.m_Roleid) { bSelf = true; } if (bSelf) { int iEP = int.Parse(sdGameLevel.instance.mainChar.GetBaseProperty()["EP"].ToString()); int iNeedEP = int.Parse(sdConfDataMgr.Instance().GetLapBossTemplateValueByStringKey(iTmpID, "CostEP")); if (iNeedEP > iEP) { sdUICharacter.Instance.ShowOkMsg("您的体力值不足", null); return; } } else { int iAP = int.Parse(sdGameLevel.instance.mainChar.GetBaseProperty()["AP"].ToString()); int iNeedAP = int.Parse(sdConfDataMgr.Instance().GetLapBossTemplateValueByStringKey(iTmpID, "CostAP")); if (iNeedAP > iAP) { sdUICharacter.Instance.ShowOkMsg("您的协助点数不足", null); return; } } if (info.m_AbyssExistTime == 0) { sdUICharacter.Instance.ShowOkMsg("该深渊已经过期", null); return; } //发送协议 CliProto.CS_LEVEL_REQ refMSG = new CliProto.CS_LEVEL_REQ(); refMSG.m_LevelBattleType = (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_ABYSS; refMSG.m_LevelID = (uint)iLevelID; sdLevelInfo.SetCurLevelId((int)refMSG.m_LevelID); refMSG.m_BuffID = 0; refMSG.m_AbyssDBID = info.m_ActDBID; SDNetGlobal.SendMessage(refMSG); // 通知宠物管理器.. sdNewPetMgr.Instance.OnEnterLevel(); sdUICharacter.Instance.iCurrentLevelID = iLevelID; sdUICharacter.Instance.bCampaignLastLevel = false; bossWnd.m_LevelID = (uint)iLevelID; sdNewInfoMgr.Instance.ClearNewInfo(NewInfoType.Type_LapBoss); } else { sdUICharacter.Instance.ShowOkMsg("请选择合适的深渊", null); } } } } } else if (gameObject.name == "btnUnlock") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd bossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (bossWnd) { if (bossWnd.m_SelectUUID == UInt64.MaxValue) { sdUICharacter.Instance.ShowOkMsg("请选择合适的深渊", null); } else { SAbyssLockInfo info = sdActGameMgr.Instance.GetLockInfo(bossWnd.m_SelectUUID); if (info != null) { if (info.m_EntranceExistTime == 0) { sdUICharacter.Instance.ShowOkMsg("该深渊入口已经过期", null); } else { sdActGameMsg.Send_CS_ABYSS_OPEN_REQ(bossWnd.m_SelectUUID); } } else { sdUICharacter.Instance.ShowOkMsg("请选择合适的深渊", null); } } sdNewInfoMgr.Instance.ClearNewInfo(NewInfoType.Type_LapBoss); } } } }
void OnClick() { // 检查剩余次数. if (m_iLevelTimesLeft <= 0) { sdUICharacter.Instance.ShowOkMsg("您已经用完此关卡的当日次数。", null); return; } // 检查剩余体力. if (m_iLevelSprite > (int)sdGameLevel.instance.mainChar.Property["EP"]) { sdUICharacter.Instance.ShowOkMsg("您的体力不足。", null); return; } // 进入战斗. //BundleGlobal.SetBundleDontUnload("UI/$FightUI.unity3d"); //sdResourceMgr.Instance.LoadResource("UI/$FightUI/Fight.prefab",OnLoadFightUI,null); sdUILoading.ActiveLoadingUI(m_strLevelLoadingTex, m_strLevelName); // 如果需要,发送队伍切换消息.. if (m_PetTeamIdx != sdNewPetMgr.Instance.mPetCurTeam) { sdPetMsg.Send_CS_PET_TEAM_RPT(m_PetTeamIdx); m_bPetTeamAck = false; } else { OnChangePetTeam(); } // 进入关卡.. CliProto.CS_LEVEL_REQ refMSG = new CliProto.CS_LEVEL_REQ(); refMSG.m_LevelBattleType = (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_NORMAL; refMSG.m_LevelID = (uint)(m_iLevelID); sdGlobalDatabase.Instance.globalData["LevelDifficulty"] = m_iDifficulty - 1; // 保存当前选择的难度.. if (sdFriendMgr.Instance.fightFriend != null) { refMSG.m_FriendPetID = sdFriendMgr.Instance.fightFriend.petInfo.m_uiTemplateID; } sdLevelInfo.SetCurLevelId((int)refMSG.m_LevelID); if (m_iChooseBuff == 0) { refMSG.m_BuffID = 10001; } else if (m_iChooseBuff == 1) { refMSG.m_BuffID = 10003; } else if (m_iChooseBuff == 2) { refMSG.m_BuffID = 10002; } else if (m_iChooseBuff == 3) { refMSG.m_BuffID = 10004; } else { refMSG.m_BuffID = 0; } SDNetGlobal.SendMessage(refMSG); // 设置要进入的关卡的信息.. sdUICharacter.Instance.iCurrentLevelID = m_iLevelID; sdUICharacter.Instance.bCampaignLastLevel = false; if (m_iDifficulty == 1 && ((m_iLevelID / 10) % 10) == 6) // 第六个关卡,且是简单难度. { for (int i = 0; i < sdLevelInfo.levelInfos.Length; i++) { if (sdLevelInfo.levelInfos[i].levelID == m_iLevelID) { if (sdLevelInfo.levelInfos[i].crystal == 0) { sdUICharacter.Instance.bCampaignLastLevel = true; } break; } } } }