1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
 
 
/// <summary>
/// 武将培养飘字处理
/// </summary>
public class HeroTrainAddAttrCell : MonoBehaviour
{
    [SerializeField] Text[] addPerText;    //增加百分比(飘动) 加入池
    [SerializeField] PositionTween addPerObject;
    
 
    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++)
        {
            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(() =>
        {
            func?.Invoke();
        });
    }
 
}