public void ParseLevelRewardData() { Dictionary <long, object> .Enumerator enumerator = GameDataMgr.resPvpLevelRewardDatabin.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <long, object> current = enumerator.get_Current(); ResPvpLevelReward resPvpLevelReward = (ResPvpLevelReward)current.get_Value(); if (resPvpLevelReward != null) { if (this.GetLevelRewardData(resPvpLevelReward.iLevel) == null) { LevelRewardData levelRewardData = new LevelRewardData(); levelRewardData.m_level = resPvpLevelReward.iLevel; levelRewardData.m_resLevelReward = resPvpLevelReward; DebugHelper.Assert(resPvpLevelReward.astLockInfo.Length <= 2, "ParseLevelRewardData 等级奖励配置表配 解锁数量不该超过2个, 翔哥 check out..."); for (int i = 0; i < resPvpLevelReward.astLockInfo.Length; i++) { ResDT_LevelReward_UnlockInfo resDT_LevelReward_UnlockInfo = resPvpLevelReward.astLockInfo[i]; if (resDT_LevelReward_UnlockInfo != null) { levelRewardData.astLockInfo[i] = resDT_LevelReward_UnlockInfo; } } this.m_levelRewardDataMap.Add(levelRewardData); } } } Dictionary <long, object> .Enumerator enumerator2 = GameDataMgr.taskDatabin.GetEnumerator(); while (enumerator2.MoveNext()) { KeyValuePair <long, object> current2 = enumerator2.get_Current(); ResTask resTask = (ResTask)current2.get_Value(); if (resTask != null) { if (resTask.dwOpenType == 2u) { int iParam = resTask.astOpenTaskParam[0].iParam; LevelRewardData levelRewardData2 = this.GetLevelRewardData(iParam); if (levelRewardData2 != null && levelRewardData2.GetResTaskIDIndex(resTask.dwTaskID) == -1) { int fristNullResTaskIndex = levelRewardData2.GetFristNullResTaskIndex(); if (fristNullResTaskIndex != -1) { levelRewardData2.task_ids[fristNullResTaskIndex] = resTask; } } } } } }
public void ParseLevelRewardData() { Dictionary <long, object> .Enumerator enumerator = GameDataMgr.resPvpLevelRewardDatabin.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <long, object> current = enumerator.Current; ResPvpLevelReward reward = (ResPvpLevelReward)current.Value; if (reward != null) { LevelRewardData item = null; if (this.GetLevelRewardData(reward.iLevel) == null) { item = new LevelRewardData { m_level = reward.iLevel, m_resLevelReward = reward }; DebugHelper.Assert(reward.astLockInfo.Length <= 2, "ParseLevelRewardData 等级奖励配置表配 解锁数量不该超过2个, 翔哥 check out..."); for (int i = 0; i < reward.astLockInfo.Length; i++) { ResDT_LevelReward_UnlockInfo info = reward.astLockInfo[i]; if (info != null) { item.astLockInfo[i] = info; } } this.m_levelRewardDataMap.Add(item); } } } Dictionary <long, object> .Enumerator enumerator2 = GameDataMgr.taskDatabin.GetEnumerator(); while (enumerator2.MoveNext()) { KeyValuePair <long, object> pair2 = enumerator2.Current; ResTask task = (ResTask)pair2.Value; if ((task != null) && (task.dwOpenType == 2)) { int iParam = task.astOpenTaskParam[0].iParam; LevelRewardData levelRewardData = this.GetLevelRewardData(iParam); if ((levelRewardData != null) && (levelRewardData.GetResTaskIDIndex(task.dwTaskID) == -1)) { int fristNullResTaskIndex = levelRewardData.GetFristNullResTaskIndex(); if (fristNullResTaskIndex != -1) { levelRewardData.task_ids[fristNullResTaskIndex] = task; } } } } }
private void ShowUnLock(LevelRewardData data, GameObject node) { if (data == null || node == null) { return; } if (this.m_unlockInfoTxt != null) { this.m_unlockInfoTxt.set_text(string.Format(Singleton <CTextManager> .instance.GetText("Task_Unlock_Text"), data.m_level)); } int num = 0; for (int i = 0; i < LevelRewardData.UNLOCK_MAX_COUNT; i++) { ResDT_LevelReward_UnlockInfo resDT_LevelReward_UnlockInfo = data.astLockInfo[i]; if (resDT_LevelReward_UnlockInfo != null && !string.IsNullOrEmpty(resDT_LevelReward_UnlockInfo.szUnlockID)) { Transform transform = node.transform.Find(string.Format("Ent_{0}", num)); DebugHelper.Assert(transform != null, "CTaskView ShowUnLock item is null, check out, name:Ent_" + num); if (transform != null) { transform.gameObject.CustomSetActive(true); Image component = transform.Find("icon").GetComponent <Image>(); DebugHelper.Assert(component != null, "CTaskView ShowUnLock icon is null, check out..."); component.SetSprite(resDT_LevelReward_UnlockInfo.szIcon, this.m_CUIForm, true, false, false, false); Text component2 = transform.Find("name").GetComponent <Text>(); DebugHelper.Assert(component2 != null, "CTaskView ShowUnLock txt is null, check out..."); if (component2 != null) { component2.set_text(resDT_LevelReward_UnlockInfo.szUnlockID); } Button component3 = transform.Find("goto_btn").GetComponent <Button>(); this._SetUnlockButton(component3, (RES_GAME_ENTRANCE_TYPE)resDT_LevelReward_UnlockInfo.bGotoID, (ulong)Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().PvpLevel >= (ulong)((long)data.m_level)); num++; } } } for (int j = num; j < LevelRewardData.UNLOCK_MAX_COUNT; j++) { Transform transform2 = node.transform.Find(string.Format("Ent_{0}", j)); if (transform2 != null) { transform2.gameObject.CustomSetActive(false); } } }