hch
2025-09-17 f306d23e461ab236ed88173f7b4a5bc35a3e9bc9
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
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
 
 
/// <summary>
/// 官职升级界面
/// </summary>
public class OfficialLVUPSuccessWin : UIBase
{
 
    [SerializeField] Text beforeNameText;
    [SerializeField] Text nameText;
    [SerializeField] Text lvText;
    [SerializeField] Text nextLVText;
    [SerializeField] Text[] attrNameText;
    [SerializeField] Text[] attrPerTextArr;
    [SerializeField] Text[] nextAttrPerTextArr;
    [SerializeField] Button okBtn;
 
 
 
    protected override void InitComponent()
    {
        okBtn.AddListener(CloseWindow);
    }
 
 
    protected override void OnPreOpen()
    {
 
        Refresh();
    }
 
    protected override void OnPreClose()
    {
    }
 
 
    public override void Refresh()
    {
        var beforeConfig = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel - 1);
        var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel);
        beforeNameText.text = beforeConfig.Name;
        beforeNameText.color = OfficialRankManager.Instance.GetOfficialRankColor(beforeConfig.Quality);
        nameText.text = config.Name;
        nameText.color = OfficialRankManager.Instance.GetOfficialRankColor(config.Quality);
        lvText.text = beforeConfig.LVMax.ToString();
        nextLVText.text = config.LVMax.ToString();
 
        for (int i = 0; i < attrNameText.Length; i++)
        {
            attrNameText[i].text = PlayerPropertyConfig.Get(config.AddAttrType[i]).Name;
            attrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(config.AddAttrType[i], beforeConfig.AddAttrNum[i]);
            nextAttrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(config.AddAttrType[i], config.AddAttrNum[i]);
        }
 
 
    }
 
}