public void SetExp(string heroid) { if (int.Parse(heroid) < 0) { var hireInfo = LTInstanceHireUtil.GetHireInfoByHeroId(int.Parse(heroid)); if (hireInfo != null) { m_Level.text = hireInfo.level.ToString(); m_Exp_Progress.gameObject.CustomSetActive(false); m_Exp_Add_Label.gameObject.CustomSetActive(false); } return; } IDictionary expData; int addExp = 0; if (DataLookupsCache.Instance.SearchDataByID <IDictionary>(RewardsPath, out expData)) { addExp = EB.Dot.Integer("quantity", expData, 0); m_Exp_Add_Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_CamapignVictoryExpDataSet_743"), addExp); } else { m_Exp_Add_Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_CamapignVictoryExpDataSet_743"), 0); } int endLevel = 0; int endExpSum = 0; DataLookupsCache.Instance.SearchIntByID(string.Format("heroStats.{0}.stat.level", heroid), out endLevel); DataLookupsCache.Instance.SearchIntByID(string.Format("heroStats.{0}.stat.xp", heroid), out endExpSum); int endLevelExp = endExpSum - Hotfix_LT.Data.CharacterTemplateManager.Instance.GerHeroPastExpSum(endLevel); float endPercent = (float)endLevelExp / (float)Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroLevelInfo(endLevel).buddy_exp; var partnerData = LTPartnerDataManager.Instance.GetPartnerByHeroId(int.Parse(heroid)); if (partnerData != null) { Hotfix_LT.Data.UpGradeInfoTemplate curTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetUpGradeInfo(partnerData.UpGradeId, partnerData.HeroInfo.char_type); if (partnerData.Level >= curTpl.level_limit) { LTUIUtil.SetLevelText(m_Level.transform.parent.GetComponent <UISprite>(), m_Level, partnerData); m_Exp_Progress.value = endPercent; return; } } int startExpSum = endExpSum - addExp; int startLevel = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroLevelByExp(startExpSum); int startLevelExp = startExpSum - Hotfix_LT.Data.CharacterTemplateManager.Instance.GerHeroPastExpSum(startLevel); float startPercent = (float)startLevelExp / (float)Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroLevelInfo(startLevel).buddy_exp; EB.Coroutines.Run(PlayExpProgressAni(startPercent, endPercent, endLevel - startLevel, startLevel)); if (m_Exp_Label != null) { LTUIUtil.SetText(m_Exp_Label, endLevelExp + "/" + Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroLevelInfo(endLevel).buddy_exp); } }
private void ShowGradeUp() { UpItem.SetItemDataOther(curParData); int oldQuality = 0; int oldAddLevel = 0; LTPartnerDataManager.GetPartnerQuality(curParData.UpGradeId - 1, out oldQuality, out oldAddLevel); CurItem.SetItemDataOther(curParData, oldQuality, oldAddLevel); Hotfix_LT.Data.UpGradeInfoTemplate tpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetUpGradeInfo(curParData.UpGradeId, curParData.HeroInfo.char_type); GradeUpLimitLv.text = string.Format(EB.Localizer.GetString("ID_LEVEL_FORMAT"), tpl.level_limit); }
public override void SetMenuData(object param) { if (param == null) { return; } for (int i = 0; i < showitemArray.Length; i++) { showitemArray[i] = controller.transform.Find("Content/UpgradeMaterial/Grid/Material (" + i + ")").GetMonoILRComponent <ShowUpgradeMaterialState>(); } curPartnerData = param as LTPartnerData; Hotfix_LT.Data.UpGradeInfoTemplate evoTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetUpGradeInfo(curPartnerData.UpGradeId + 1, curPartnerData.HeroInfo.char_type); materialList = evoTpl.materialDic; isExDouble = ActivityUtil.isTimeLimitActivityOpen(1003); isSceneDouble = ActivityUtil.isTimeLimitActivityOpen(1002); }