using System;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
|
namespace Snxxz.UI
|
{
|
[XLua.Hotfix]
|
public class CrossServerWin : Window
|
{
|
[SerializeField] Button leftBtn;
|
[SerializeField] Button rightBtn;
|
[SerializeField] Button closeBtn;
|
[SerializeField] FunctionButton arenaFunc;
|
[SerializeField] FunctionButton bossFunc;
|
[SerializeField] FunctionButton m_HazyRegion;
|
[SerializeField] FunctionButtonGroup funcGroup;
|
#region Built-in
|
protected override void BindController()
|
{
|
|
}
|
protected override void AddListeners()
|
{
|
closeBtn.AddListener(ClickClose);
|
leftBtn.AddListener(ClickLeft);
|
rightBtn.AddListener(ClickRight);
|
arenaFunc.AddListener(ClickArenaFunc);
|
bossFunc.AddListener(ClickBossFunc);
|
m_HazyRegion.AddListener(OpenHazyRegion);
|
}
|
|
protected override void OnPreOpen()
|
{
|
|
}
|
|
protected override void OnActived()
|
{
|
base.OnActived();
|
funcGroup.TriggerByOrder(functionOrder);
|
}
|
|
protected override void OnAfterOpen()
|
{
|
|
}
|
|
protected override void OnPreClose()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<MainInterfaceWin>();
|
}
|
protected override void OnAfterClose()
|
{
|
|
}
|
#endregion
|
|
#region 点击事件
|
|
private void ClickBossFunc()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<CrossServerBossWin>();
|
functionOrder = bossFunc.order;
|
}
|
|
private void ClickArenaFunc()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<CrossServerOneVsOneWin>();
|
functionOrder = arenaFunc.order;
|
}
|
|
private void OpenHazyRegion()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<HazyRegionWin>();
|
functionOrder = m_HazyRegion.order;
|
}
|
|
private void ClickRight()
|
{
|
funcGroup.TriggerNext();
|
}
|
|
private void ClickLeft()
|
{
|
funcGroup.TriggerLast();
|
}
|
|
private void ClickClose()
|
{
|
CloseSubWindows();
|
CloseImmediately();
|
}
|
|
private void CloseSubWindows()
|
{
|
var children = WindowConfig.Get().FindChildWindows("CrossServerWin");
|
foreach (var window in children)
|
{
|
WindowCenter.Instance.Close(window);
|
}
|
}
|
#endregion
|
}
|
}
|