using Core.Language; using Excel2Json; using Fort23.UTool; using GameLogic.Hero; using UnityEngine.UI; namespace Fort23.Mono { [UIBinding(prefab = "HeroDetailPanel" )] public partial class HeroDetailPanel : UIPanel { private void Init() { // InitHeroDetailPanel(); } protected override void AddEvent() { } protected override void DelEvent() { } public override void AddButtonEvent() { btnBack.onClick.AddListener(OnClickClose); } private void OnClickClose() { UIManager.Instance.HideUIUIPanel(this); } public void InitHeroDetailPanel(HeroInfo heroInfo) { iconZhiYe.icon_name = heroInfo.iconZhiYe; heroName.text = LanguageManager.Instance.Text(heroInfo.modelConfig.name); HeroUITools.SetStarShow(stars, heroInfo.star.Value); switch (heroInfo.modelConfig.rarity) { case 1: heroRarity.text = LanguageManager.Instance.Text(32); break; case 2: heroRarity.text = LanguageManager.Instance.Text(31); break; case 3: heroRarity.text = LanguageManager.Instance.Text(30); break; default: LogTool.Error("找不到hero的稀有度:" + heroInfo.modelConfig.ID); break; } txtHP.text = heroInfo.hp.Value.ToString(); txtATK.text = heroInfo.attack.Value.ToString(); txtDEF.text = heroInfo.defense.Value.ToString(); txtSHANBI.text = heroInfo.shanbi.Value.ToString(); txtLv.text = heroInfo.level.Value.ToString(); txtExpGain.text = heroInfo.expGain.Value.ToString(); } } }