//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Tuesday, October 31, 2017
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
|
public class FindPreciousFrameWin : Window
|
{
|
[SerializeField] FunctionButtonGroup m_FunctionGroup;
|
[SerializeField] FunctionButton m_DemonJar;
|
[SerializeField] FunctionButton m_WorldBoss;
|
[SerializeField] FunctionButton m_BossHome;
|
[SerializeField] FunctionButton m_PersonalBoss;
|
[SerializeField] FunctionButton m_ElderGodArea;
|
[SerializeField] FunctionButton m_DropRecord;
|
|
[SerializeField] Button m_Left;
|
[SerializeField] Button m_Right;
|
[SerializeField] Button m_Close;
|
|
#region Built-in
|
protected override void BindController()
|
{
|
}
|
|
protected override void AddListeners()
|
{
|
m_DemonJar.AddListener(ShowDemonJar);
|
m_WorldBoss.AddListener(ShowWorldBoss);
|
m_BossHome.AddListener(ShowBossHome);
|
m_PersonalBoss.AddListener(ShowPersonalBoss);
|
m_ElderGodArea.AddListener(ShowElderGodArea);
|
m_DropRecord.AddListener(ShowDropRecord);
|
|
m_Left.AddListener(ShowLastFunction);
|
m_Right.AddListener(ShowNextFunction);
|
m_Close.AddListener(CloseClick);
|
}
|
|
protected override void OnPreOpen()
|
{
|
|
}
|
|
protected override void OnAfterOpen()
|
{
|
}
|
|
protected override void OnPreClose()
|
{
|
CloseSubWindows();
|
}
|
|
protected override void OnAfterClose()
|
{
|
if (!WindowJumpMgr.Instance.IsJumpState)
|
{
|
WindowCenter.Instance.Open<MainInterfaceWin>();
|
}
|
}
|
|
protected override void OnActived()
|
{
|
base.OnActived();
|
m_Left.gameObject.SetActive(m_FunctionGroup.unLockedCount > 1);
|
m_Right.gameObject.SetActive(m_FunctionGroup.unLockedCount > 1);
|
|
m_FunctionGroup.TriggerByOrder(functionOrder);
|
m_FunctionGroup.GotoOrder(functionOrder);
|
}
|
#endregion
|
|
private void ShowDemonJar()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<DemonJarWin>();
|
functionOrder = m_DemonJar.order;
|
}
|
|
private void ShowWorldBoss()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<WorldBossWin>();
|
functionOrder = m_WorldBoss.order;
|
}
|
|
private void ShowBossHome()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<BossHomeWin>();
|
functionOrder = m_BossHome.order;
|
}
|
|
private void ShowPersonalBoss()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<PersonalBossWin>();
|
functionOrder = m_PersonalBoss.order;
|
}
|
|
private void ShowElderGodArea()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<ElderGodAreaWin>();
|
functionOrder = m_ElderGodArea.order;
|
}
|
|
private void ShowDropRecord()
|
{
|
CloseSubWindows();
|
WindowCenter.Instance.Open<PreciousDropRecordWin>();
|
functionOrder = m_DropRecord.order;
|
}
|
|
private void CloseSubWindows()
|
{
|
var subWindows = WindowConfig.Get().FindChildWindows("FindPreciousFrameWin");
|
foreach ( var window in subWindows )
|
{
|
WindowCenter.Instance.Close(window);
|
}
|
}
|
|
private void ShowLastFunction()
|
{
|
m_FunctionGroup.TriggerLast();
|
}
|
|
private void ShowNextFunction()
|
{
|
m_FunctionGroup.TriggerNext();
|
}
|
|
}
|
|
}
|
|
|
|
|