//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Wednesday, January 09, 2019
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI {
|
//成就活动面板
|
public class AchievementActivityWin : Window
|
{
|
|
#region Built-in
|
[SerializeField] FunctionButtonGroup FuncBtnGroup;
|
[SerializeField] Button _CloseBtn;
|
[SerializeField] Button _LeftBtn;
|
[SerializeField] Button _RightBtn;
|
[SerializeField] FunctionButton m_OpenServiceAchievementBtn;//周狂欢
|
protected override void BindController()
|
{
|
}
|
|
protected override void AddListeners()
|
{
|
_CloseBtn.AddListener(OnClickClose);
|
_LeftBtn.AddListener(OnClickLeftBtn);
|
_RightBtn.AddListener(OnClickRight);
|
m_OpenServiceAchievementBtn.AddListener(OpenServiceAchievementButton);
|
}
|
|
protected override void OnPreOpen()
|
{
|
if (WindowCenter.Instance.IsOpen<MainInterfaceWin>())
|
{
|
WindowCenter.Instance.Close<MainInterfaceWin>();
|
}
|
functionOrder = 0;
|
|
}
|
|
protected override void OnActived()
|
{
|
FuncBtnGroup.TriggerByOrder(functionOrder);
|
}
|
protected override void OnAfterOpen()
|
{
|
|
}
|
|
protected override void OnPreClose()
|
{
|
CloseChild();
|
if (!WindowCenter.Instance.IsOpen<MainInterfaceWin>())
|
{
|
WindowCenter.Instance.Open<MainInterfaceWin>();
|
}
|
}
|
|
protected override void OnAfterClose()
|
{
|
}
|
|
public void OnClickClose()
|
{
|
Close();
|
}
|
public void OnClickLeftBtn()
|
{
|
FuncBtnGroup.TriggerLast();
|
}
|
|
public void OnClickRight()
|
{
|
FuncBtnGroup.TriggerNext();
|
}
|
|
void CloseChild()
|
{
|
if (WindowCenter.Instance.IsOpen<OpenServiceAchievementWin>())
|
{
|
WindowCenter.Instance.CloseImmediately<OpenServiceAchievementWin>();
|
}
|
}
|
|
private void OpenServiceAchievementButton()
|
{
|
CloseChild();
|
if (windowState == WindowState.Opened)
|
{
|
WindowCenter.Instance.OpenWithoutAnimation<OpenServiceAchievementWin>();
|
}
|
else
|
{
|
WindowCenter.Instance.Open<OpenServiceAchievementWin>(true);
|
}
|
functionOrder = 0;
|
}
|
#endregion
|
|
}
|
|
}
|