hch
1 天以前 6521aa56fbeba8d6509d5736bd35b1d42dcc4029
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
 
/// <summary>
/// 坐骑进阶成功
/// </summary>
public class HorseSuccessWin : UIBase
{
    [SerializeField] Text curLVText;
    [SerializeField] Text nextLVText;
    [SerializeField] Text[] attrNameTexts;
    [SerializeField] Text[] attrValueTexts;
    [SerializeField] Text[] nextAttrValueTexts;
 
    [SerializeField] Transform[] specialAttrRect;
    [SerializeField] Text[] specialAttrNameTexts;
    [SerializeField] Text[] specialAttrValueTexts;
    [SerializeField] Text[] specialNextAttrValueTexts;
    [SerializeField] Button okBtn;
 
 
 
    protected override void InitComponent()
    {
        okBtn.AddListener(CloseWindow);
    }
 
 
    protected override void OnPreOpen()
    {
        Display();
    }
 
    protected override void OnPreClose()
    {
    }
 
 
    void Display()
    {
        var config = HorseClassConfig.Get(HorseManager.Instance.classLV - 1);
        curLVText.text = Language.Get("Horse8", HorseManager.Instance.classLV - 1, config.MaxLV);
        nextLVText.text = Language.Get("Horse8", HorseManager.Instance.classLV, 1);
 
        var nextConfig = HorseClassConfig.Get(HorseManager.Instance.classLV);
 
        var keys = HorseManager.Instance.attrDic.Keys.ToList();
        keys.Sort();
        for (int i = 0; i < attrNameTexts.Length; i++)
        {
            if (i < keys.Count)
            {
                var curValue = HorseManager.Instance.attrDic[keys[i]];
                attrNameTexts[i].text = PlayerPropertyConfig.Get(keys[i]).Name;
                attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], 
                    curValue - nextConfig.ClassAttrValueList[i] - nextConfig.PerLVAttrValueList[i], 2);
                nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], curValue, 2);
            }
        }
 
        var nextKeys = HorseManager.Instance.specialAttrDic.Keys.ToList();
        nextKeys.Sort();
        for (int i = 0; i < specialAttrRect.Length; i++)
        {
            if (i < nextConfig.ClassSpecAttrIDList.Length)
            {
                specialAttrRect[i].SetActive(true);
                var id = nextConfig.ClassSpecAttrIDList[i];
                specialAttrNameTexts[i].text = PlayerPropertyConfig.Get(id).Name;
                if (i < nextKeys.Count)
                {
                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, 
                        HorseManager.Instance.specialAttrDic[nextKeys[i]] - nextConfig.ClassSpecAttrValueList[i], 2);
                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, 
                        HorseManager.Instance.specialAttrDic[nextKeys[i]], 2);
                }
                else
                {
                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, 0);
                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, nextConfig.ClassSpecAttrValueList[i], 2);
                }
            }
            else
            {
                specialAttrRect[i].SetActive(false);
            }
        }
 
 
    }
 
}