| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using DG.Tweening; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | |
| | | public class HeroTrainAddAttrCell : MonoBehaviour |
| | | { |
| | | [SerializeField] Text[] addPerText; //增加百分比(飘动) 加入池 |
| | | [SerializeField] PositionTween addPerObject; |
| | | [SerializeField] Transform addPerObject; |
| | | |
| | | |
| | | public void Display(int value, Action func) |
| | | public void Display(HeroInfo hero, Action func) |
| | | { |
| | | int value = hero.qualityConfig.LVAddPer; |
| | | addPerObject.SetActive(true); |
| | | var lvConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel + 1); |
| | | var beforeLVConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel); |
| | | for (int i = 0; i < addPerText.Length; i++) |
| | | { |
| | | addPerText[i].text = "+" + PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], value); |
| | | var addValue = lvConfig.AttrValueList[i] - beforeLVConfig.AttrValueList[i]; |
| | | string addString = ""; |
| | | if (addValue != 0) |
| | | { |
| | | addString = $"+{addValue}\n"; |
| | | } |
| | | addPerText[i].text = addString + "+" + PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], value); |
| | | } |
| | | addPerObject.Play(() => |
| | | addPerObject.localPosition = new Vector3(0, 0, 0); |
| | | addPerObject.DOLocalMove(new Vector3(0, 40, 0), 0.5f).OnComplete(()=> |
| | | { |
| | | func?.Invoke(); |
| | | }); |
| | | } |
| | | ); |
| | | |
| | | } |
| | | |
| | | } |