public void OnBreakThrouthBtnClick() { //判断上限,材料//ID_HANDBOOK_HAS_MAX_LEVEL int curLevel = LTPartnerHandbookManager.Instance.GetHandBookLevel(); var curHandBookInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMannualScoreTemplateById(curLevel); if (BreakLevel >= curHandBookInfo.levelLimit) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_HANDBOOK_HAS_MAX_LEVEL")); return; } var data = LTPartnerHandbookManager.Instance.TheHandbookList.Find(Type); Hotfix_LT.Data.MannualBreakTemplate breakThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel + 1); int curCount = GameItemUtil.GetInventoryItemNum(breakThrough.material_1); int nextCount = breakThrough.quantity_1; if (curCount < nextCount) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_HANDBOOK_BTN_TIP2")); return;//材料不足 } LTPartnerHandbookManager.Instance.BreakThrough((int)Type, delegate { UpLevelFx.CustomSetActive(false); UpLevelFx.CustomSetActive(true); curAddATKLabel.GetComponent <TweenScale>().ResetToBeginning(); curAddATKLabel.GetComponent <TweenScale>().PlayForward(); curAddDefLabel.GetComponent <TweenScale>().ResetToBeginning(); curAddDefLabel.GetComponent <TweenScale>().PlayForward(); curAddMAXHPLabel.GetComponent <TweenScale>().ResetToBeginning(); curAddMAXHPLabel.GetComponent <TweenScale>().PlayForward(); }); }
private void CheckBreakItem() { var data = LTPartnerHandbookManager.Instance.TheHandbookList.Find(Type); Hotfix_LT.Data.MannualBreakTemplate breakThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel + 1); if (breakThrough != null) { int curCount = GameItemUtil.GetInventoryItemNum(breakThrough.material_1); int nextCount = breakThrough.quantity_1; string color = curCount < nextCount ? LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal : LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal; BreakItemLabel.text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat + "/{2}", color, curCount, nextCount); RedPoint.CustomSetActive(curCount >= nextCount); } else { RedPoint.CustomSetActive(false); } }
private void UpdateInfo() { var data = LTPartnerHandbookManager.Instance.TheHandbookList.Find(Type); if (data == null) { EB.Debug.LogError("LTPartnerHandbookDetailCtrl.UpdateInfo data == null"); return; } Hotfix_LT.Data.MannualBreakTemplate curThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel); if (curThrough == null) { EB.Debug.LogError("LTPartnerHandbookDetailCtrl.UpdateInfo curThrough == null"); return; } BreakLevel = data.BreakLevel; CurLevelLabel.text = data.BreakLevel.ToString(); curAddATKLabel.text = string.Format("{0}%", Mathf.FloorToInt(curThrough.IncATK * 100)); curAddDefLabel.text = string.Format("{0}%", Mathf.FloorToInt(curThrough.IncDEF * 100)); curAddMAXHPLabel.text = string.Format("{0}%", Mathf.FloorToInt((curThrough.IncMaxHp * 100))); Hotfix_LT.Data.MannualBreakTemplate breakThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel + 1); if (breakThrough != null)//可升级 { NextLevelLabe.gameObject.CustomSetActive(true); NextLevelLabe.text = (data.BreakLevel + 1).ToString(); nextAddATKLabel.text = string.Format("+{0}%", Mathf.RoundToInt((breakThrough.IncATK - curThrough.IncATK) * 100)); nextAddDefLabel.text = string.Format("+{0}%", Mathf.RoundToInt((breakThrough.IncDEF - curThrough.IncDEF) * 100)); nextAddMaxHPLabel.text = string.Format("+{0}%", Mathf.RoundToInt((breakThrough.IncMaxHp - curThrough.IncMaxHp) * 100)); BreakItem.LTItemData = new LTShowItemData(breakThrough.material_1, breakThrough.quantity_1, LTShowItemType.TYPE_GAMINVENTORY, false); BreakItem.mDMono.gameObject.CustomSetActive(true); int curCount = GameItemUtil.GetInventoryItemNum(breakThrough.material_1); int nextCount = breakThrough.quantity_1; string color = curCount < nextCount ? LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal : LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal; BreakItemLabel.text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat + "/{2}", color, curCount, nextCount); RedPoint.CustomSetActive(curCount >= nextCount); BreakBtnBox.enabled = true; BreakBtnLabel.text = EB.Localizer.GetString("ID_HANDBOOK_LEVEL_UP1"); } else//不可升级 { NextLevelLabe.gameObject.CustomSetActive(false); nextAddATKLabel.text = string.Empty; nextAddDefLabel.text = string.Empty; nextAddMaxHPLabel.text = string.Empty; BreakItem.mDMono.gameObject.CustomSetActive(false); RedPoint.CustomSetActive(false); BreakBtnBox.enabled = false; BreakBtnLabel.text = EB.Localizer.GetString("ID_HAS_MAX_LEVEL"); } cardData = data.CardsInfo; SetShowHandBookData(); SetTurnPageText(); if (isFristRegister) { isFristRegister = false; return; } LTPartnerDataManager.Instance.OnDestineTypePowerChanged(Type, (prm) => { LTFormationDataManager.OnRefreshMainTeamPower(prm); }, true); }