| using UnityEngine; | 
|   | 
| public class FirstChargeHeroInfoWin : UIBase | 
| { | 
|     [SerializeField] ItemCell itemCell; | 
|     [SerializeField] TextEx txtName; | 
|     [SerializeField] TextEx txtJob; | 
|     [SerializeField] TextEx txtDesc; | 
|     [SerializeField] RichText txtInherit;   //武将继承描述 | 
|     [SerializeField] TextEx[] txtInheritAttr;    //武将会继承的属性 | 
|     [SerializeField] RichText txtHeroAddPer; //主公(上阵)加成描述 | 
|     [SerializeField] TextEx[] txtHeroAddAttrPer; //主公(上阵)加成 | 
|     [SerializeField] SkillBaseCell normalSkillCell; | 
|     [SerializeField] SkillBaseCell angerSkillCell; | 
|   | 
|     protected override void InitComponent() | 
|     { | 
|         base.InitComponent(); | 
|         txtInherit.OnClick = () => | 
|         { | 
|             SmallTipWin.showText = Language.Get("herocard47"); | 
|             SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); | 
|             UIManager.Instance.OpenWindow<SmallTipWin>(); | 
|         }; | 
|         txtHeroAddPer.OnClick = () => | 
|         { | 
|             SmallTipWin.showText = Language.Get("herocard48"); | 
|             SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); | 
|             UIManager.Instance.OpenWindow<SmallTipWin>(); | 
|         }; | 
|   | 
|     } | 
|   | 
|     protected override void OnPreOpen() | 
|     { | 
|         base.OnPreOpen(); | 
|         ItemInfo itemInfo = new ItemInfo(); | 
|         itemInfo.itemId = FirstChargeManager.Instance.heroItemID; | 
|         HeroInfo heroInfo = new HeroInfo(new ItemModel(PackType.Item, itemInfo)); | 
|         txtInheritAttr[0].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[0], heroInfo.heroConfig.AtkInheritPer)); | 
|         txtInheritAttr[1].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[1], heroInfo.heroConfig.DefInheritPer)); | 
|         txtInheritAttr[2].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[2], heroInfo.heroConfig.HPInheritPer)); | 
|   | 
|         int valuePer = heroInfo.GetFakeOnBattleAddPer(); | 
|         for (int i = 0; i < txtHeroAddAttrPer.Length; i++) | 
|         { | 
|             txtHeroAddAttrPer[i].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.basePerAttrs[i], valuePer)); | 
|         } | 
|   | 
|         normalSkillCell.Init(heroInfo.heroConfig.AtkSkillID, () => | 
|         { | 
|             UIManager.Instance.OpenWindow<HeroSkillWin>(heroInfo.heroId); | 
|         }, true); | 
|         angerSkillCell.Init(heroInfo.heroConfig.AngerSkillID, () => | 
|         { | 
|             UIManager.Instance.OpenWindow<HeroSkillWin>(heroInfo.heroId); | 
|         }, true); | 
|   | 
|         itemCell.Init(new ItemCellModel((int)FirstChargeManager.Instance.heroItemID, true, 1)); | 
|         txtName.text = Language.Get("FirstCharge09", Language.Get("CommonQuality" + heroInfo.Quality),heroInfo.heroConfig.Name);  | 
|         txtName.color = UIHelper.GetUIColorByFunc(heroInfo.Quality); | 
|         txtJob.text = Language.Get("FirstCharge06",Language.Get(StringUtility.Contact("HeroClass",heroInfo.heroConfig.Class))); | 
|         txtDesc.text = Language.Get("FirstCharge07",heroInfo.heroConfig.Desc); | 
|     } | 
|      | 
|     protected override void OnPreClose() | 
|     { | 
|         base.OnPreClose(); | 
|   | 
|     } | 
|   | 
| } |