少年修仙传客户端代码仓库
client_Wu Xijin
2019-04-28 3b50d06d004ecc31df7ecaa57927fa35c1ea608e
System/FindPrecious/FindPreciousFrameWin.cs
@@ -12,37 +12,20 @@
namespace Snxxz.UI
{
    public class FindPreciousFrameWin : Window
    public class FindPreciousFrameWin : OneLevelWin
    {
        [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);
            base.AddListeners();
            SetFunctionListener(0, ShowDemonJar);
            SetFunctionListener(1, ShowWorldBoss);
            SetFunctionListener(2, ShowBossHome);
            SetFunctionListener(3, ShowPersonalBoss);
            SetFunctionListener(4, ShowElderGodArea);
            SetFunctionListener(5, ShowDropRecord);
        }
        protected override void OnPreOpen()
@@ -61,20 +44,11 @@
        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
@@ -82,61 +56,42 @@
        {
            CloseSubWindows();
            WindowCenter.Instance.Open<DemonJarWin>();
            functionOrder = m_DemonJar.order;
            functionOrder = 0;
        }
        private void ShowWorldBoss()
        {
            CloseSubWindows();
            WindowCenter.Instance.Open<WorldBossWin>();
            functionOrder = m_WorldBoss.order;
            functionOrder = 1;
        }
        private void ShowBossHome()
        {
            CloseSubWindows();
            WindowCenter.Instance.Open<BossHomeWin>();
            functionOrder = m_BossHome.order;
            functionOrder = 2;
        }
        private void ShowPersonalBoss()
        {
            CloseSubWindows();
            WindowCenter.Instance.Open<PersonalBossWin>();
            functionOrder = m_PersonalBoss.order;
            functionOrder = 3;
        }
        private void ShowElderGodArea()
        {
            CloseSubWindows();
            WindowCenter.Instance.Open<ElderGodAreaWin>();
            functionOrder = m_ElderGodArea.order;
            functionOrder = 4;
        }
        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();
            functionOrder = 5;
        }
    }