using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI
|
{
|
public class BlessedLandDefeatedWin : Window
|
{
|
[SerializeField] ButtonEx btnExit;
|
[SerializeField] Text txtExit;
|
int TimeS;
|
|
protected override void AddListeners()
|
{
|
|
}
|
|
protected override void BindController()
|
{
|
btnExit.SetListener(Close);
|
}
|
void Close()
|
{
|
WindowCenter.Instance.Close<BlessedLandDefeatedWin>();
|
}
|
protected override void OnPreOpen()
|
{
|
TimeS = 5;
|
GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
|
txtExit.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", TimeS);
|
}
|
|
protected override void OnPreClose()
|
{
|
GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
|
}
|
|
private void OnSecondEvent()
|
{
|
TimeS -= 1;
|
txtExit.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", TimeS);
|
if (TimeS <= 0)
|
Close();
|
}
|
|
protected override void OnAfterClose()
|
{
|
|
}
|
|
protected override void OnAfterOpen()
|
{
|
|
}
|
|
|
}
|
|
}
|
|
|