/// <summary> /// 初始化初始选择Item /// </summary> private void InitSelect() { int maxLevel = 0; DataLookupsCache.Instance.SearchIntByID("userCampaignStatus.challengeChapters.bigFloor", out maxLevel); maxLevel += 1; Hotfix_LT.Data.LostChallengeChapter temp = Hotfix_LT.Data.SceneTemplateManager.Instance.GetCheckPointChapterByChapter(maxLevel); if (temp == null)//满层通关 { maxCheckPointLevel = 1000; temp = Hotfix_LT.Data.SceneTemplateManager.Instance.GetCheckPointChapterByChapter(maxLevel - 1); } else { maxCheckPointLevel = temp.Level; } CurSelectLevel = temp.Level; List <Hotfix_LT.Data.LostChallengeChapter> list = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostChallengeCheckPointChapterList(); int index = list.IndexOf(temp); DynamicScroll.MoveInternalNow((index - 4 < 0) ? 0 : index - 4); InitDrop(); BlitzObj.CustomSetActive(GetShowBlitzObj()); RecommendLevelLabel.gameObject.CustomSetActive(temp.RecommendLevel > 0 && maxCheckPointLevel <= CurSelectLevel); if (temp.RecommendLevel > 0 && maxCheckPointLevel <= CurSelectLevel) { RecommendLevelLabel.text = string.Format("{0}:{1}", EB.Localizer.GetString("ID_CHALLENGE_RECOMMEND"), temp.RecommendLevel); int userLevel = BalanceResourceUtil.GetUserLevel(); RecommendBGSprite.spriteName = (userLevel >= temp.RecommendLevel) ? "Ty_Welfare_Label_5" : "Welfare_Label_6"; } }
/// <summary> /// 关卡难度选择事件 /// </summary> /// <param name="evt"></param> public void OnLevelSelect(int level) { if (level != CurSelectLevel) { CurSelectLevel = level; Hotfix_LT.Data.LostChallengeChapter temp = Hotfix_LT.Data.SceneTemplateManager.Instance.GetCheckPointChapter(CurSelectLevel); InitDrop(); BlitzObj.CustomSetActive(GetShowBlitzObj()); RecommendLevelLabel.gameObject.CustomSetActive(temp.RecommendLevel > 0 && maxCheckPointLevel <= CurSelectLevel); if (temp.RecommendLevel > 0 && maxCheckPointLevel <= CurSelectLevel) { RecommendLevelLabel.text = string.Format("{0}:{1}", EB.Localizer.GetString("ID_CHALLENGE_RECOMMEND"), temp.RecommendLevel); int userLevel = BalanceResourceUtil.GetUserLevel(); RecommendBGSprite.spriteName = (userLevel >= temp.RecommendLevel) ? "Ty_Welfare_Label_5" : "Welfare_Label_6"; } } }