//-------------------------------------------------------- // [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()) { WindowCenter.Instance.Close(); } functionOrder = 0; } protected override void OnActived() { FuncBtnGroup.TriggerByOrder(functionOrder); } protected override void OnAfterOpen() { } protected override void OnPreClose() { CloseChild(); if (!WindowCenter.Instance.IsOpen()) { WindowCenter.Instance.Open(); } } protected override void OnAfterClose() { } public void OnClickClose() { Close(); } public void OnClickLeftBtn() { FuncBtnGroup.TriggerLast(); } public void OnClickRight() { FuncBtnGroup.TriggerNext(); } void CloseChild() { if (WindowCenter.Instance.IsOpen()) { WindowCenter.Instance.CloseImmediately(); } } private void OpenServiceAchievementButton() { CloseChild(); if (windowState == WindowState.Opened) { WindowCenter.Instance.OpenWithoutAnimation(); } else { WindowCenter.Instance.Open(true); } functionOrder = 0; } #endregion } }