//世界Boss界面.. public void ActiveWorldBossWnd(GameObject PreWnd) { if (m_UIWorldBossWnd == null) { sdUILoading.ActiveSmallLoadingUI(true); ResLoadParams param = new ResLoadParams(); param.userdata0 = PreWnd as object; sdResourceMgr.Instance.LoadResource("UI/ActGame/$WorldBoss/WorldBossWnd.prefab", LoadWorldBossWnd, param, typeof(GameObject)); return; } if (PreWnd) { PreWnd.SetActive(false); } m_UIWorldBossWnd.SetActive(true); m_UIWorldBossWnd.transform.parent = sdGameLevel.instance.UICamera.transform; m_UIWorldBossWnd.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); m_UIWorldBossWnd.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f); sdUIWorldBossWnd obj = m_UIWorldBossWnd.GetComponent <sdUIWorldBossWnd>(); if (obj != null) { obj.ActiveWorldBossWnd(PreWnd); } }
//世界boss结算反馈.. private static void msg_SC_WB_RESULT_ACK(int iMsgID, ref CMessage msg) { CliProto.SC_WB_RESULT_ACK refMsg = (CliProto.SC_WB_RESULT_ACK)msg; if (refMsg.m_Result == 0) { HeaderProto.SWorldBossInfo info = refMsg.m_Info; sdActGameMgr.Instance.BuildWorldBossInfo(info); GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIWorldBossWnd bossWnd = wnd.GetComponentInChildren <sdUIWorldBossWnd>(); if (bossWnd) { bossWnd.RefreshWorldBossUI(); bossWnd.RefreshLBItemListPage(); sdActGameMgr.Instance.m_uuWorldBossLastBlood = sdActGameMgr.Instance.m_WorldBossInfo.m_Blood; sdActGameMgr.Instance.m_uuWorldBossNowBlood = sdActGameMgr.Instance.m_WorldBossInfo.m_Blood; bNeedResetWorldBossHP = true; } } } }
//世界boss鼓舞buff反馈.. private static void msg_SC_WB_ADD_BUF_ACK(int iMsgID, ref CMessage msg) { CliProto.SC_WB_ADD_BUF_ACK refMsg = (CliProto.SC_WB_ADD_BUF_ACK)msg; sdActGameMgr.Instance.m_iWBMyBuff = refMsg.m_Result; GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIWorldBossWnd bossWnd = wnd.GetComponentInChildren <sdUIWorldBossWnd>(); if (bossWnd) { bossWnd.RefreshWorldBossUI(); } } }
//世界boss信息刷新反馈.. private static void msg_SC_WB_INFO_REFRESH_ACK(int iMsgID, ref CMessage msg) { CliProto.SC_WB_INFO_REFRESH_ACK refMsg = (CliProto.SC_WB_INFO_REFRESH_ACK)msg; HeaderProto.SWorldBossInfo info = refMsg.m_Info; sdActGameMgr.Instance.BuildWorldBossInfo(info); GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIWorldBossWnd bossWnd = wnd.GetComponentInChildren <sdUIWorldBossWnd>(); if (bossWnd) { bossWnd.RefreshWorldBossUI(); bossWnd.RefreshLBItemListPage(); } } }
//进入世界boss反馈.. private static void msg_SC_WB_ENTER_ACK(int iMsgID, ref CMessage msg) { CliProto.SC_WB_ENTER_ACK refMsg = (CliProto.SC_WB_ENTER_ACK)msg; if (refMsg.m_Result == 0) { HeaderProto.SWorldBossInfo info = refMsg.m_Info; sdActGameMgr.Instance.BuildWorldBossInfo(info); GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIWorldBossWnd bossWnd = wnd.GetComponentInChildren <sdUIWorldBossWnd>(); if (bossWnd) { bossWnd.RefreshWorldBossUI(); bossWnd.RefreshLBItemListPage(); int iLevelID = sdActGameMgr.Instance.GetWorldBossLevelID(); if (iLevelID > 0) { sdLevelInfo.SetCurLevelId(iLevelID); // 通知宠物管理器.. sdNewPetMgr.Instance.OnEnterLevel(); sdUICharacter.Instance.iCurrentLevelID = iLevelID; sdUICharacter.Instance.bCampaignLastLevel = false; sdUICharacter.Instance.SetBattleType((byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_WORLD_BOSS); //申请进入场景.. BundleGlobal.SetBundleDontUnload("UI/$FightUI.unity3d"); sdResourceMgr.Instance.LoadResource("UI/UIPrefab/$Fight.prefab", sdUIWorldBossWndBtn.OnLoadFightUI, null); sdUILoading.ActiveLoadingUI("cave1", "凶恶的世界BOSS"); bossWnd.setbossmodelVisible(false); bossWnd.m_bWorldBossAck = true; sdActGameMgr.Instance.m_uuWorldBossLastBlood = sdActGameMgr.Instance.m_WorldBossInfo.m_Blood; sdActGameMgr.Instance.m_uuWorldBossNowBlood = sdActGameMgr.Instance.m_WorldBossInfo.m_Blood; } } } } }
void OnClick() { if (gameObject.name == "wndClose") { //直接关闭界面.. if (sdGameLevel.instance.levelType == sdGameLevel.LevelType.MainCity || sdGameLevel.instance.levelType == sdGameLevel.LevelType.WorldMap) { if (sdActGameControl.m_UIWorldBossWnd != null) { sdActGameControl.Instance.CloseGameWnd(sdActGameControl.m_UIWorldBossWnd); } } else { if (sdActGameControl.m_UIWorldBossWnd != null) { sdActGameControl.Instance.CloseGameWnd(sdActGameControl.m_UIWorldBossWnd); } //退出世界Boss场景.. sdUICharacter.Instance.TuiTu_To_WorldMap(); } } else if (gameObject.name == "btnMoney") { if (sdActGameMgr.Instance.m_WorldBossInfo.m_Status == 2) { sdActGameMsg.Send_CS_WB_ADD_BUF_REQ(0); } } else if (gameObject.name == "btnRmb") { if (sdActGameMgr.Instance.m_WorldBossInfo.m_Status == 2) { sdActGameMsg.Send_CS_WB_ADD_BUF_REQ(1); } } else if (gameObject.name == "TabRank") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIWorldBossWnd bossWnd = wnd.GetComponentInChildren <sdUIWorldBossWnd>(); if (bossWnd) { bossWnd.ShowRightUIPanel(false); } } } else if (gameObject.name == "TabDesc") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIWorldBossWnd bossWnd = wnd.GetComponentInChildren <sdUIWorldBossWnd>(); if (bossWnd) { bossWnd.ShowRightUIPanel(true); } } } else if (gameObject.name == "btnBegin") { //可以进入BOSS场景.. if (sdGameLevel.instance.levelType == sdGameLevel.LevelType.MainCity || sdGameLevel.instance.levelType == sdGameLevel.LevelType.WorldMap) { if (sdActGameMgr.Instance.m_WorldBossInfo.m_Status == 2) { int iLevelID = sdActGameMgr.Instance.GetWorldBossLevelID(); if (iLevelID > 0) { //发协议.. if (sdActGameMgr.Instance.m_WorldBossInfo.m_ReliveTime > 0) { sdActGameMsg.Send_CS_WB_RELIVE_REQ(); } else { sdActGameMsg.Send_CS_WB_ENTER_REQ(); } } } } //已经在BOSS场景中,请求复活.. else { if (sdActGameMgr.Instance.m_WorldBossInfo.m_Status == 2 && sdActGameMgr.Instance.m_WorldBossInfo.m_ReliveTime > 0) { sdActGameMsg.Send_CS_WB_RELIVE_REQ(); } else if (sdActGameMgr.Instance.m_WorldBossInfo.m_Status == 2 && sdActGameMgr.Instance.m_WorldBossInfo.m_ReliveTime <= 0) { sdActGameMsg.Send_CS_WB_ENTER_REQ(); } } } else if (gameObject.name == "worldBossBtn") { sdActGameControl.Instance.ActiveWorldBossWnd(null); } //活动平台的按钮事件.. else if (gameObject.name == "btnActClose") { if (sdUICharacter.Instance.GetTownUI() != null) { sdUICharacter.Instance.GetTownUI().GetComponent <sdTown>().lockPanel.SetActive(false); } if (sdActGameControl.m_UIActBaseWnd != null) { sdActGameControl.Instance.CloseGameWnd(sdActGameControl.m_UIActBaseWnd); } } else if (gameObject.name == "btnLapBoss") { sdActGameControl.Instance.ActiveLapBossWnd(null, 1); sdNewInfoMgr.Instance.ClearNewInfo(NewInfoType.Type_LapBoss); } else if (gameObject.name == "btnWorldBoss") { sdActGameControl.Instance.ActiveWorldBossWnd(null); } }