using UnityEngine;
|
using UnityEngine.UI;
|
public class TianziBillboradSweepTipWin : UIBase
|
{
|
[SerializeField] ButtonEx btnOK;
|
[SerializeField] ButtonEx btnClose;
|
[SerializeField] TextEx txtTodayHurt;
|
[SerializeField] TextEx txtBoxCount;
|
[SerializeField] Toggle toggle;
|
TianziBillboradManager model { get { return TianziBillboradManager.Instance; } }
|
|
protected override void InitComponent()
|
{
|
base.InitComponent();
|
btnClose.SetListener(CloseWindow);
|
btnOK.SetListener(() =>
|
{
|
int remainChallageCount = model.GetRemainChallageCount();
|
if (remainChallageCount <= 0)
|
{
|
SysNotifyMgr.Instance.ShowTip("TianziBillborad02");
|
return;
|
}
|
model.SendBBeginFBWipeOut();
|
CloseWindow();
|
});
|
toggle.onValueChanged.AddListener(OnValueChanged);
|
}
|
protected override void OnPreOpen()
|
{
|
base.OnPreOpen();
|
Display();
|
}
|
|
public void Display()
|
{
|
toggle.isOn = false;
|
txtTodayHurt.text = Language.Get("TianziBillborad05", UIHelper.ReplaceLargeNum(model.historyHurt));
|
int boxCount = model.CalculateSweepBoxCount(model.todayHurt);
|
txtBoxCount.text = UIHelper.AppendColor(boxCount > 0 ? TextColType.Green : TextColType.Red, Language.Get("TianziBillborad07", boxCount));
|
}
|
|
private void OnValueChanged(bool value)
|
{
|
model.isSkipSweepTip = value;
|
}
|
|
}
|