using System;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI
|
{
|
public class AutoLuckyTreasurePopWin : Window
|
{
|
[SerializeField] Button okBtn;
|
[SerializeField] Button cancelBtn;
|
[SerializeField] Button closeBtn;
|
|
LuckyTreasureModel luckyTreasureModel { get { return ModelCenter.Instance.GetModel<LuckyTreasureModel>(); } }
|
#region Built-in
|
protected override void BindController()
|
{
|
|
}
|
|
protected override void AddListeners()
|
{
|
closeBtn.AddListener(CloseClick);
|
okBtn.AddListener(ClickOk);
|
cancelBtn.AddListener(CloseClick);
|
}
|
|
protected override void OnPreOpen()
|
{
|
|
}
|
|
protected override void OnAfterOpen()
|
{
|
|
}
|
|
protected override void OnPreClose()
|
{
|
|
}
|
|
protected override void OnAfterClose()
|
{
|
|
}
|
#endregion
|
|
private void ClickOk()
|
{
|
CloseImmediately();
|
bool isSatify = luckyTreasureModel.IsSatifyLuckyTreasure();
|
if(isSatify)
|
{
|
luckyTreasureModel.isAutoLuckyTreasure = true;
|
if (!WindowCenter.Instance.IsOpen<AutomaticTreasureWin>())
|
{
|
WindowCenter.Instance.Open<AutomaticTreasureWin>();
|
}
|
}
|
}
|
|
}
|
}
|