// 初始化扫荡按钮 文字 void InitBtnName() { RoleInfo role = LobbyClient.Instance.CurrentRole; string chn_desc = ""; chn_desc = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(903); string wipeStr = ""; if (m_SubSceneType == SubSceneType.Common) { chn_desc = string.Format(chn_desc, 10); wipeStr = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(905); } else if (m_SubSceneType == SubSceneType.Master) { int complete_count = role.GetCompletedSceneCount(m_SceneId); complete_count = complete_count > 3 ? 3 : complete_count; chn_desc = string.Format(chn_desc, 3); wipeStr = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(906); } if (wipeBtnLabel != null) { wipeBtnLabel.text = chn_desc; } if (wipeNote != null) { wipeNote.text = wipeStr; } }
//扫荡事件 public void OnWipeoutBtnClick() { if (m_SubSceneType == SubSceneType.Master) { } RoleInfo role = LobbyClient.Instance.CurrentRole; if (null != role) { ItemDataInfo info = role.GetItemData(ItemConfigProvider.Instance.GetSweepStageItemId(), 0); if (null != info) { Data_SceneConfig sceneCfg = SceneConfigProvider.Instance.GetSceneConfigById(m_SceneId); if (role.CurStamina < sceneCfg.m_CostStamina) { SendDialog(907, 4, null); return; } if (info.ItemNum < 1) { SendDialog(901, 4, null); return; } if (m_SubSceneType == SubSceneType.Common) { if (info.ItemNum >= 1) { LogicSystem.PublishLogicEvent("ge_sweep_stage", "lobby", m_SceneId, 1); return; } } else if (m_SubSceneType == SubSceneType.Master) { if (info.ItemNum >= 1) { int complete_count = role.GetCompletedSceneCount(m_SceneId); if (complete_count < 3) { LogicSystem.PublishLogicEvent("ge_sweep_stage", "lobby", m_SceneId, 1); return; } else { SendDialog(902, 4, null); return; } } } } else { SendDialog(901, 4, null); } } }
// 初始化扫荡劵 public void InitWipeNum() { RoleInfo role = LobbyClient.Instance.CurrentRole; if (null != role) { ItemDataInfo info = role.GetItemData(ItemConfigProvider.Instance.GetSweepStageItemId(), 0); if (null != info) { wipeOutNum.text = info.ItemNum.ToString(); } else { wipeOutNum.text = "0"; } } //显示剩余次数 if (m_SubSceneType == SubSceneType.Master) { if (lblChallengeInfo != null && lblChallengeInfo.transform.parent != null) { NGUITools.SetActive(lblChallengeInfo.transform.parent.gameObject, true); } int complete_count = role.GetCompletedSceneCount(m_SceneId); m_CompleteCount = complete_count; complete_count = complete_count > 3 ? 3 : complete_count; if (lblChallengeInfo != null) { lblChallengeInfo.text = (3 - complete_count) + " / 3"; } } else { if (lblChallengeInfo != null && lblChallengeInfo.transform.parent != null) { NGUITools.SetActive(lblChallengeInfo.transform.parent.gameObject, false); } } }