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]);
|
}
|
|
|
}
|
|
}
|