//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Wednesday, February 27, 2019
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
|
public class EquipFrameWin : Window
|
{
|
[SerializeField] Button m_Close;
|
|
[SerializeField] FunctionButtonGroup m_Group;
|
[SerializeField] FunctionButton m_Star;
|
[SerializeField] FunctionButton m_Strengthen;
|
[SerializeField] FunctionButton m_Inlay;
|
[SerializeField] FunctionButton m_Train;
|
[SerializeField] Button m_Last;
|
[SerializeField] Button m_Next;
|
|
#region Built-in
|
protected override void BindController()
|
{
|
}
|
|
protected override void AddListeners()
|
{
|
m_Close.SetListener(CloseEquipFrameWin);
|
m_Star.AddListener(OpenStarWin);
|
m_Strengthen.AddListener(OpenStrengthenWin);
|
m_Inlay.AddListener(OpenInlayWin);
|
m_Train.AddListener(OpenTrainWin);
|
|
m_Last.SetListener(() => { m_Group.TriggerLast(); });
|
m_Next.SetListener(() => { m_Group.TriggerNext(); });
|
}
|
|
protected override void OnPreOpen()
|
{
|
}
|
|
protected override void OnAfterOpen()
|
{
|
|
}
|
|
protected override void OnPreClose()
|
{
|
CloseSubWindows();
|
if (!WindowJumpMgr.Instance.IsJumpState)
|
{
|
WindowCenter.Instance.Open<MainInterfaceWin>();
|
}
|
}
|
|
protected override void OnAfterClose()
|
{
|
}
|
|
protected override void OnActived()
|
{
|
base.OnActived();
|
m_Group.TriggerByOrder(functionOrder);
|
}
|
|
#endregion
|
|
private void CloseSubWindows()
|
{
|
var children = WindowConfig.Get().FindChildWindows("EquipFrameWin");
|
foreach (var item in children)
|
{
|
WindowCenter.Instance.Close(item);
|
}
|
}
|
|
private void OpenStarWin()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<EquipStarWin>();
|
functionOrder = m_Star.order;
|
}
|
|
private void OpenStrengthenWin()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<EquipStrengthWin>();
|
functionOrder = m_Strengthen.order;
|
}
|
|
private void OpenInlayWin()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<EquipGemWin>();
|
functionOrder = m_Inlay.order;
|
}
|
|
private void OpenTrainWin()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<EquipTrainWin>();
|
functionOrder = m_Train.order;
|
}
|
|
private void CloseEquipFrameWin()
|
{
|
WindowCenter.Instance.Close<EquipFrameWin>();
|
}
|
|
}
|
|
}
|