using System;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI
|
{
|
public class HeavenVictoryWin : Window
|
{
|
[SerializeField] Text winCntText;
|
[SerializeField] Text fightTimeText;
|
[SerializeField] Text expValueText;
|
[SerializeField] Text rewardValueText;
|
[SerializeField] Button sureBtn;
|
|
DungeonModel m_Model;
|
DungeonModel model
|
{
|
get
|
{
|
return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DungeonModel>());
|
}
|
}
|
|
protected override void BindController()
|
{
|
|
}
|
|
protected override void AddListeners()
|
{
|
sureBtn.AddListener(ClickSureBtn);
|
}
|
|
protected override void OnPreOpen()
|
{
|
InitUI();
|
}
|
protected override void OnAfterOpen()
|
{
|
this.transform.SetAsLastSibling();
|
}
|
|
protected override void OnPreClose()
|
{
|
|
}
|
protected override void OnAfterClose()
|
{
|
|
}
|
|
private void InitUI()
|
{
|
winCntText.text = model.dungeonResult.conWinCnt.ToString();
|
fightTimeText.text = TimeUtility.SecondsToMS((int)(model.dungeonResult.costTime * 0.001f));
|
string expStr = UIHelper.ReplaceLargeNum((ulong)model.dungeonResult.totalExp);
|
if(model.dungeonResult.extraTotalExp > 0)
|
{
|
string extraExp = StringUtility.Contact("<color=#8ddc11>", "(+", UIHelper.ReplaceLargeNum((ulong)model.dungeonResult.extraTotalExp), ")", "</color>");
|
expStr = StringUtility.Contact(expStr,extraExp);
|
}
|
expValueText.text = expStr;
|
|
string scoreStr = UIHelper.ReplaceLargeNum((ulong)model.dungeonResult.score);
|
if(model.dungeonResult.extrScore > 0)
|
{
|
string extraScore = StringUtility.Contact("<color=#8ddc11>", "(+", UIHelper.ReplaceLargeNum((ulong)model.dungeonResult.extrScore), ")", "</color>");
|
scoreStr = StringUtility.Contact(scoreStr,extraScore);
|
}
|
rewardValueText.text = scoreStr;
|
|
}
|
|
private void ClickSureBtn()
|
{
|
CloseImmediately();
|
model.ExitCurrentDungeon();
|
}
|
}
|
}
|