/// <summary> /// 设置数据 /// </summary> /// <param name="data">数据</param> private void SetBoss(Hotfix_LT.Data.AllianceFBBoss data) { // Hotfix_LT.Data.MonsterInfoTemplate monsterTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMonsterInfo(data.monsterId); if (monsterTpl == null) { EB.Debug.LogError("LTLegionFBHudController InitBoss, monsterTpl is Error monsterID = {0}", data.monsterId); return; } Hotfix_LT.Data.HeroInfoTemplate info = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(monsterTpl.character_id); if (info == null) { EB.Debug.LogError("LTLegionFBHudController InitBoss, info is Error monsterTpl.character_id = {0}", monsterTpl.character_id); return; } if (mDMono.gameObject.activeInHierarchy) { StartCoroutine(CreateBossModel(info.model_name)); } LTUIUtil.SetText(v_MonsterName, info.name); // SetReward(data.Rewards); }
/// <summary> /// 设置相应BOSS的红点 /// </summary> /// <param name="red">红点</param> /// <param name="index">当前的BOSS索引</param> /// <param name="currentProgress">当前的开放的进度条</param> /// <param name="need">是否需要判断红点</param> private void SetBossRedPoint(GameObject red, int index, int currentProgress, bool need) { if (need) { Hotfix_LT.Data.AllianceFBBoss currentBoss = Hotfix_LT.Data.AllianceTemplateManager.Instance.mFBBossList[index]; //获取当前BOSS的挑战次数 int challenge = EB.Dot.Integer(currentBoss.monsterId.ToString(), m_BossChallengeNumInfo, 0); // red.SetActive(currentBoss.challenge > challenge && currentProgress >= currentBoss.donate); } }
private void SetBoss(int index, bool updateInfo) { index = index % Hotfix_LT.Data.AllianceTemplateManager.Instance.mFBBossList.Count; m_CurrentBoss = Hotfix_LT.Data.AllianceTemplateManager.Instance.mFBBossList[index]; SetBoss(m_CurrentBoss); //将左右按钮隐藏及打开设置 bool leftBtnVisible = index != 0; bool rightBtnVisible = index != Hotfix_LT.Data.AllianceTemplateManager.Instance.mFBBossList.Count - 1; v_LeftBossBtn.SetActive(leftBtnVisible); v_RightBossBtn.SetActive(rightBtnVisible); //刷新排行榜 v_RankController.F_UpdateBossRank(m_CurrentBoss.monsterId); int current = LegionModel.GetInstance().legionData.todayExp; if (updateInfo) { //获取当前BOSS的挑战次数 LegionLogic.GetInstance().OnSendGetCurDonateInfo((Hashtable obj) => { DataLookupsCache.Instance.CacheData(obj); Hashtable hashtable = EB.Dot.Object("alliance", obj, null); hashtable = EB.Dot.Object("todayDonateTimes", hashtable, null); m_BossChallengeNumInfo = EB.Dot.Object("boss", hashtable, null); MaxBoxCount = EB.Dot.Integer("bossBoxCount." + m_CurrentBoss.monsterId.ToString(), hashtable, -1); //设置扫荡相关 SetBossWipeInfo(MaxBoxCount > -1); int challenge = EB.Dot.Integer(m_CurrentBoss.monsterId.ToString(), m_BossChallengeNumInfo, 0); if (challenge >= 0) { //设置当前的BOSS挑战次数 SetChanllengeBtnTips(m_CurrentBoss.challenge - challenge, m_CurrentBoss.challenge); } LegionLogic.GetInstance().IsOpenLegionFB(); SetBossRedPoint(v_LeftBossRes, index - 1, current, leftBtnVisible); SetBossRedPoint(v_RightBossRes, index + 1, current, rightBtnVisible); }); } else { int challenge = EB.Dot.Integer(m_CurrentBoss.monsterId.ToString(), m_BossChallengeNumInfo, 0); //设置扫荡相关 SetBossWipeInfo(DataLookupsCache.Instance.SearchDataByID <int>("alliance.todayDonateTimes.bossBoxCount." + m_CurrentBoss.monsterId.ToString(), out MaxBoxCount)); if (challenge >= 0) { //设置当前的BOSS挑战次数 SetChanllengeBtnTips(m_CurrentBoss.challenge - challenge, m_CurrentBoss.challenge); } //判断是否需要打开相应的红点 SetBossRedPoint(v_LeftBossRes, index - 1, current, leftBtnVisible); SetBossRedPoint(v_RightBossRes, index + 1, current, rightBtnVisible); } //处理进度条的情况 int total = m_CurrentBoss.donate; v_ChallengeBtn.SetActive(!(current < total)); v_ProgressPanel.SetActive(current < total); SetProgressPanel(current, total); }