using System;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
public class FairylandCeremonyWin : Window
|
{
|
[SerializeField] FunctionButtonGroup funcBtnGroup;
|
[SerializeField] FunctionButton rechargeFunc;
|
[SerializeField] FunctionButton fireFunc;
|
[SerializeField] FunctionButton peopleToHiFunc;
|
[SerializeField] FunctionButton outofFunc;
|
[SerializeField] Button leftBtn;
|
[SerializeField] Button rightBtn;
|
[SerializeField] Button closeBtn;
|
|
protected override void BindController()
|
{
|
|
}
|
|
protected override void AddListeners()
|
{
|
rechargeFunc.onClick.AddListener(ClickRecharge);
|
fireFunc.onClick.AddListener(ClickFire);
|
peopleToHiFunc.onClick.AddListener(ClickPeopleToHi);
|
outofFunc.onClick.AddListener(ClickOutOf);
|
leftBtn.onClick.AddListener(OnClickLeftBtn);
|
rightBtn.onClick.AddListener(OnClickRightBtn);
|
closeBtn.onClick.AddListener(ClickClose);
|
}
|
|
protected override void OnPreOpen()
|
{
|
|
}
|
protected override void OnActived()
|
{
|
base.OnActived();
|
funcBtnGroup.TriggerByOrder(functionOrder);
|
}
|
|
protected override void OnAfterOpen()
|
{
|
|
}
|
|
protected override void OnPreClose()
|
{
|
|
}
|
|
protected override void OnAfterClose()
|
{
|
if(!WindowJumpMgr.Instance.IsJumpState)
|
{
|
WindowCenter.Instance.Open<MainInterfaceWin>();
|
}
|
}
|
|
private void OnClickRightBtn()
|
{
|
funcBtnGroup.TriggerNext();
|
}
|
|
private void OnClickLeftBtn()
|
{
|
funcBtnGroup.TriggerLast();
|
}
|
|
private void ClickOutOf()
|
{
|
CloseChildWin();
|
if (windowState == WindowState.Opened)
|
{
|
WindowCenter.Instance.OpenWithoutAnimation<CeremonyOutOfPrintWin>();
|
}
|
else
|
{
|
WindowCenter.Instance.Open<CeremonyOutOfPrintWin>();
|
}
|
functionOrder = 3;
|
}
|
|
private void ClickPeopleToHi()
|
{
|
CloseChildWin();
|
if (windowState == WindowState.Opened)
|
{
|
WindowCenter.Instance.OpenWithoutAnimation<CeremonyPeopleToHiWin>();
|
}
|
else
|
{
|
WindowCenter.Instance.Open<CeremonyPeopleToHiWin>();
|
}
|
functionOrder = 2;
|
}
|
|
private void ClickFire()
|
{
|
CloseChildWin();
|
if (windowState == WindowState.Opened)
|
{
|
WindowCenter.Instance.OpenWithoutAnimation<CeremonyFirepartyWin>();
|
}
|
else
|
{
|
WindowCenter.Instance.Open<CeremonyFirepartyWin>();
|
}
|
functionOrder = 1;
|
}
|
|
private void ClickRecharge()
|
{
|
CloseChildWin();
|
if (windowState == WindowState.Opened)
|
{
|
WindowCenter.Instance.OpenWithoutAnimation<CeremonyRechargeGiftWin>();
|
}
|
else
|
{
|
WindowCenter.Instance.Open<CeremonyRechargeGiftWin>();
|
}
|
functionOrder = 0;
|
}
|
|
private void CloseChildWin()
|
{
|
if (WindowCenter.Instance.CheckOpen<CeremonyRechargeGiftWin>())
|
{
|
WindowCenter.Instance.CloseImmediately<CeremonyRechargeGiftWin>();
|
}
|
if (WindowCenter.Instance.CheckOpen<CeremonyFirepartyWin>())
|
{
|
WindowCenter.Instance.CloseImmediately<CeremonyFirepartyWin>();
|
}
|
if (WindowCenter.Instance.CheckOpen<CeremonyPeopleToHiWin>())
|
{
|
WindowCenter.Instance.CloseImmediately<CeremonyPeopleToHiWin>();
|
}
|
if (WindowCenter.Instance.CheckOpen<CeremonyOutOfPrintWin>())
|
{
|
WindowCenter.Instance.CloseImmediately<CeremonyOutOfPrintWin>();
|
}
|
}
|
|
|
private void ClickClose()
|
{
|
CloseChildWin();
|
CloseClick();
|
}
|
}
|
}
|