using UnityEngine;
|
|
namespace vnxbqy.UI
|
{
|
//福地-管理
|
public class BlessedLandManageMouseRenewalPopWin : Window
|
{
|
[SerializeField] ButtonEx btnClose;
|
[SerializeField] TextEx txtHireTime;
|
[SerializeField] BlessedLandManageMouseButton btnBuy1;
|
[SerializeField] BlessedLandManageMouseButton btnBuy2;
|
|
BlessedLandModel blessedLandModel { get { return ModelCenter.Instance.GetModel<BlessedLandModel>(); } }
|
|
protected override void BindController()
|
{
|
}
|
|
protected override void AddListeners()
|
{
|
btnClose.SetListener(CloseClick);
|
}
|
|
protected override void OnPreOpen()
|
{
|
GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
|
Display();
|
DisplayTime();
|
}
|
|
protected override void OnAfterOpen()
|
{
|
}
|
|
protected override void OnAfterClose()
|
{
|
}
|
|
protected override void OnPreClose()
|
{
|
GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
|
}
|
|
private void OnSecondEvent()
|
{
|
DisplayTime();
|
}
|
|
public void Display()
|
{
|
//type 1折的表现用图片还是下划线 1下划线 2 图片
|
//index 管家档位购买对应充值ID列表中的1维索引
|
btnBuy1.Display(2, 0);
|
btnBuy2.Display(2, 1);
|
}
|
|
public void DisplayTime()
|
{
|
string hireTime = TimeUtility.SecondsToDHMS((int)blessedLandModel.HousekeeperEndTime - TimeUtility.AllSeconds);
|
string hireTimeText = Language.Get("BlessedLand068", UIHelper.AppendColor(TextColType.Green, hireTime, true));
|
txtHireTime.text = hireTimeText;
|
}
|
}
|
}
|