//-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Wednesday, January 17, 2018 //-------------------------------------------------------- using UnityEngine; using System.Collections; using UnityEngine.UI; namespace Snxxz.UI { public class LootPreciousFrameWin : Window { [SerializeField] FunctionButtonGroup m_FunctionGroup; [SerializeField] FunctionButton m_DemonJar; [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_Left.AddListener(ShowLastFunction); m_Right.AddListener(ShowNextFunction); m_Close.AddListener(CloseClick); } protected override void OnPreOpen() { } protected override void OnAfterOpen() { } protected override void OnPreClose() { CloseSubWindows(); if(!WindowJumpMgr.Instance.IsJumpState) { WindowCenter.Instance.Open(); } } protected override void OnAfterClose() { } 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); } #endregion private void ShowDemonJar() { CloseSubWindows(); if (windowState == WindowState.Opened) { WindowCenter.Instance.OpenWithoutAnimation(); } else { WindowCenter.Instance.Open(); } functionOrder = m_DemonJar.order; } private void CloseSubWindows() { WindowCenter.Instance.CloseImmediately(); } private void ShowLastFunction() { m_FunctionGroup.TriggerLast(); } private void ShowNextFunction() { m_FunctionGroup.TriggerNext(); } } }