using System;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
public class JadeDynastyKnapSackWin : Window
|
{
|
[SerializeField] FunctionButton funcEquip;
|
[SerializeField] FunctionButtonGroup funcGroup;
|
[SerializeField] Button closeBtn;
|
[SerializeField] Button leftBtn;
|
[SerializeField] Button rightBtn;
|
|
#region Built-in
|
protected override void BindController()
|
{
|
|
}
|
protected override void AddListeners()
|
{
|
closeBtn.AddListener(CloseClick);
|
leftBtn.AddListener(ClickLeft);
|
rightBtn.AddListener(ClickRight);
|
funcEquip.AddListener(ClickFuncEquip);
|
}
|
protected override void OnPreOpen()
|
{
|
|
}
|
|
protected override void OnActived()
|
{
|
base.OnActived();
|
funcGroup.TriggerByOrder(functionOrder);
|
}
|
|
protected override void OnAfterOpen()
|
{
|
|
}
|
|
protected override void OnPreClose()
|
{
|
|
}
|
|
protected override void OnAfterClose()
|
{
|
|
}
|
#endregion
|
|
private void ClickRight()
|
{
|
funcGroup.TriggerNext();
|
}
|
private void ClickLeft()
|
{
|
funcGroup.TriggerLast();
|
}
|
private void ClickFuncEquip()
|
{
|
CloseSubWindows();
|
if (windowState == WindowState.Opened)
|
{
|
WindowCenter.Instance.OpenWithoutAnimation<JadeDynastyKnapSackWin>();
|
}
|
else
|
{
|
WindowCenter.Instance.Open<JadeDynastyKnapSackWin>();
|
}
|
functionOrder = funcEquip.order;
|
}
|
private void CloseSubWindows()
|
{
|
var children = WindowConfig.Get().FindChildWindows(this.GetType().Name);
|
foreach (var window in children)
|
{
|
WindowCenter.Instance.Close(window);
|
}
|
}
|
}
|
}
|