少年修仙传客户端代码仓库
client_Wu Xijin
2018-08-13 eda22bcd9683f3a94e0744da60d23808272c627f
System/MainInterfacePanel/HighSettingTip.cs
@@ -1,459 +1,460 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Friday, September 08, 2017
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using TableConfig;
using System;
using System.Collections.Generic;
//顶层面板框按钮
namespace Snxxz.UI
{
    public class HighSettingTip : MonoBehaviour
    {
        [SerializeField] Button _DaTreasureBtn;//打宝按钮
        [SerializeField] Button m_LootPrecious;//夺宝
        [SerializeField] Button _MarketBtn;//市场按钮
        [SerializeField] Button _ShoppingBtn;//商城按钮
        [SerializeField] Button _RechargeBtn;//充值按钮
        [SerializeField] Button _WelfareBtn;//福利按钮
        [SerializeField] Button _TreasureBtn;//寻宝按钮
        [SerializeField] Button m_OpenService;//开服活动按钮
        [SerializeField] Button _RuneTaBtn;//符印按钮
        [SerializeField] Image m_OpenServerTitle;
        [SerializeField] Transform m_HighSettingTip;//判定
        [SerializeField] GameObject m_HighSettingShow;//是否开启切换功能
        [SerializeField] Button _ShowBtn;//切换按钮1
        [SerializeField] Button _ColseBtn;//切换按钮2
        [SerializeField] UIEffect m_OSCEffect;//开服活动特效
        [SerializeField] UIEffect m_StoreEffect;//商城特效
        [SerializeField] Button storeDesBtn;  //商城活动描述信息
        [SerializeField] HighSettingFadeInFadeOut m_HighSettingFadeInFadeOut;
        [SerializeField] Button m_Treasure;//法宝入口
        [SerializeField] Button m_HappyXBBtn;//寻宝入口
        [SerializeField] Button m_FindHostBtn;//仙宝寻主
        [SerializeField] RechargeBtnBehaviour m_RechargetBtnBehaviour;
        [SerializeField] Button m_OSGiftBtn;
        [SerializeField] Button m_LimitedTimePBtn;//限时礼包
        [SerializeField] Button m_ElfFestivalBtn;//仙界盛典
        private bool _bool = true;
        private int swicthCdTime = 0;
        private bool IsFadeOut = true;
        private bool isNeedTip = true;
        StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
        OSGiftModel osGiftModel { get { return ModelCenter.Instance.GetModel<OSGiftModel>(); } }
        PlayerMainDate mainModel { get { return ModelCenter.Instance.GetModel<PlayerMainDate>(); } }
        private void Start()
        {
            isNeedTip = true;
        }
        public void Init()
        {
            swicthCdTime = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("AutomaticSwitch").Numerical1);
            OpenServerActivityStateChange();
            CheckOSGift();
            m_RechargetBtnBehaviour.Init();
            m_HighSettingFadeInFadeOut.Init();
            storeDesBtn.AddListener(() => { storeDesBtn.gameObject.SetActive(false); });
            m_LootPrecious.AddListener(LootPreciousButton);
            _MarketBtn.AddListener(MarketButton);
            _ShoppingBtn.AddListener(ShoppingButton);
            _TreasureBtn.AddListener(TreasureButton);
            _WelfareBtn.AddListener(WelfareButton);
            _DaTreasureBtn.AddListener(DaTreasureButton);
            _RechargeBtn.AddListener(RechargeButton);
            m_Treasure.AddListener(OpenTreasure);
            _ShowBtn.AddListener(ShowButton);
            _ColseBtn.AddListener(ColseButton);
            m_HappyXBBtn.AddListener(OnClickHappyXBBtn);
            m_FindHostBtn.AddListener(OnClickFindHostBtn);
            m_OpenService.AddListener(OpenService);
            m_OSGiftBtn.AddListener(OSGiftBtn);
            _RuneTaBtn.onClick.AddListener(RuneTaButton);
            m_LimitedTimePBtn.AddListener(OnCliCkLimitedTimePBtn);
            m_ElfFestivalBtn.AddListener(OnClickElfFestivalBtn);
            if (_bool)
            {
                ColseButton();
            }
            if (_ColseBtn.gameObject.activeSelf)
            {
                CoroutineMgr.Instance.OnMainStartCorUp(swicthCdTime);
            }
            CoroutineMgr.Instance.MainHighTipCdTimeEvent += OnMainHighTipCdTime;
            FunctionUnlockFlyObjectTarget.IsPlayerUiEffect += IsPlayerUiEffect;
            osGiftModel.OnOSGiftStateChange += CheckOSGift;
            storeModel.StoreFuncOpenAct += OnStoreFuncOpen;
            OpenServerActivityCenter.Instance.openServerActivityStateChange += OpenServerActivityStateChange;
        }
        public void OnActived()
        {
            if (_ColseBtn.gameObject.activeInHierarchy)
            {
                m_HighSettingFadeInFadeOut.PositionNow();
            }
            else
            {
                if (mainModel.IsRedPointShowPanel())
                {
                    ShowButtonNow();
                }
                else
                {
                    m_HighSettingFadeInFadeOut.PositionDel();
                }
            }
        }
        public void UnInit()
        {
            m_LootPrecious.RemoveAllListeners();
            _MarketBtn.RemoveAllListeners();
            _ShoppingBtn.RemoveAllListeners();
            _TreasureBtn.RemoveAllListeners();
            _WelfareBtn.RemoveAllListeners();
            _DaTreasureBtn.RemoveAllListeners();
            _RechargeBtn.RemoveAllListeners();
            m_Treasure.RemoveAllListeners();
            _ShowBtn.RemoveAllListeners();
            _ColseBtn.RemoveAllListeners();
            m_OpenService.RemoveAllListeners();
            m_HappyXBBtn.RemoveAllListeners();
            m_FindHostBtn.RemoveAllListeners();
            m_OSGiftBtn.RemoveAllListeners();
            m_LimitedTimePBtn.RemoveAllListeners();
            _RuneTaBtn.onClick.RemoveAllListeners();
            CoroutineMgr.Instance.MainHighTipCdTimeEvent -= OnMainHighTipCdTime;
            FunctionUnlockFlyObjectTarget.IsPlayerUiEffect -= IsPlayerUiEffect;
            FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChange;
            storeModel.StoreFuncOpenAct -= OnStoreFuncOpen;
            osGiftModel.OnOSGiftStateChange -= CheckOSGift;
            OpenServerActivityCenter.Instance.openServerActivityStateChange -= OpenServerActivityStateChange;
            CoroutineMgr.Instance.OnMainStopCorUP();
            m_HighSettingFadeInFadeOut.Unit();
            m_RechargetBtnBehaviour.UnInit();
        }
        private void OnFuncStateChange(int obj)
        {
            if (this.gameObject.activeInHierarchy)
            {
                StartCoroutine(DelayFrame());
            }
        }
        IEnumerator DelayFrame()
        {
            yield return WaitingForSecondConst.WaitMS200;
            SwithButtonObj();
        }
        public void AfterOpen()
        {
            FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChange;
            SwithButtonObj();
            RefreshOSCEffect();
            RefreshStoreEffect();
        }
        private void OnDisable()
        {
            StopCoroutine(DelayHideStoreDes());
        }
        private void IsPlayerUiEffect()
        {
            if (NewBieCenter.Instance.inGuiding)
            {
                return;
            }
            if (!m_HighSettingFadeInFadeOut.GetIsFadeIn())
            {
                m_HighSettingFadeInFadeOut.PositionDel();//立刻隐藏
            }
        }
        private void OpenServerActivityStateChange()
        {
            int _order = 0;
            m_OpenService.gameObject.SetActive(OpenServerActivityCenter.Instance.IsAnyActivityOpen(out _order));
        }
        private void OnMainHighTipCdTime()
        {
            ColseButton();
        }
        void MarketButton()//市场按钮
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<MarketWin>();
        }
        void OpenService()//开服活动
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<OpenServerActivityWin>();
        }
        void ShoppingButton()//商城按钮
        {
            if (FuncOpen.Instance.IsFuncOpen(79))
            {
                WindowCenter.Instance.Close<MainInterfaceWin>();
                WindowCenter.Instance.Open<StoreWin>();
            }
            else
            {
                SysNotifyMgr.Instance.ShowTip("UnopenedFunction");
            }
        }
        void TreasureButton()//寻宝按钮
        {
        }
        void WelfareButton()//福利按钮
        {
            WelfareCenter.Instance.OpenWelfare();
        }
        void DaTreasureButton()//打宝按钮
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<FindPreciousFrameWin>();
        }
        void LootPreciousButton()//夺宝
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<LootPreciousFrameWin>();
        }
        void RechargeButton()//充值按钮
        {
            if (VersionConfig.Get().isBanShu)
            {
                SysNotifyMgr.Instance.ShowTip("FuncNoOpen_Nowaday");
                return;
            }
            switch (m_RechargetBtnBehaviour.state)
            {
                case 1:
                    if (!NewBieCenter.Instance.inGuiding)
                    {
                        WindowCenter.Instance.Close<MainInterfaceWin>();
                        WindowCenter.Instance.Open<FirstRechargeWin>(true);
                    }
                    break;
                //case 2:
                //    WindowCenter.Instance.Open<OpenServerGiftWin>();
                //    break;
                case 3:
                    WindowCenter.Instance.Close<MainInterfaceWin>();
                    WindowCenter.Instance.Open<VipRechargeWin>(false, 0);
                    break;
            }
        }
        private void OSGiftBtn()
        {
            if (osGiftModel.giftGetNotify)
            {
                osGiftModel.giftGetNotify = false;
            }
            WindowCenter.Instance.Open<OpenServerGiftWin>();
        }
        void RuneTaButton()//符印塔
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<RuneTowerWin>();
        }
        private void CheckOSGift()
        {
            m_OSGiftBtn.gameObject.SetActive(osGiftModel.activate);
            SwithButtonObj();
        }
        void OpenTreasure()
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            var _model = ModelCenter.Instance.GetModel<TreasureModel>();
            if (_model.GetTreasureUnlockShow(TreasureCategory.Human) != 0)
            {
                _model.currentCategory = TreasureCategory.Human;
            }
            WindowCenter.Instance.Open<TreasureSelectWin>();
        }
        void OnClickHappyXBBtn()//寻宝
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<HappyXBWin>();
        }
        void OnClickFindHostBtn()//仙宝寻主
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<TreasureFindHostWin>();
        }
        void OnCliCkLimitedTimePBtn()//限时礼包
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<LimitedTimePackageWin>();
        }
        void OnClickElfFestivalBtn()
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<FairylandCeremonyWin>();
        }
        public void ShowButton()//向上
        {
            _ColseBtn.gameObject.SetActive(true);
            _ShowBtn.gameObject.SetActive(false);
            if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>() && m_HighSettingTip.gameObject.activeSelf)
            {
                m_HighSettingFadeInFadeOut.FadeOut();//淡出
            }
            CoroutineMgr.Instance.OnMainStartCorUp(swicthCdTime);
        }
        public void ColseButton()//向下
        {
            if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>() && m_HighSettingTip.gameObject.activeSelf)
            {
                _ShowBtn.gameObject.SetActive(true);
                _ColseBtn.gameObject.SetActive(false);
                m_HighSettingFadeInFadeOut.FadeIn();//淡入
                _bool = false;
                CoroutineMgr.Instance.OnMainStopCorUP();
            }
        }
        public void ColseButtonNow()//向下(立刻隐藏)
        {
            if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>() && m_HighSettingTip.gameObject.activeSelf)
            {
                _ShowBtn.gameObject.SetActive(true);
                _ColseBtn.gameObject.SetActive(false);
                m_HighSettingFadeInFadeOut.PositionDel();//立刻隐藏
                _bool = false;
                CoroutineMgr.Instance.OnMainStopCorUP();
            }
        }
        public void ShowButtonNow()//向上(立刻出现)
        {
            _ColseBtn.gameObject.SetActive(true);
            _ShowBtn.gameObject.SetActive(false);
            if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>() && m_HighSettingTip.gameObject.activeSelf)
            {
                m_HighSettingFadeInFadeOut.PositionNow();//立刻出现
            }
            //if (!mainModel.IsRedPointShowPanel())
            //{
            //    CoroutineMgr.Instance.OnMainStartCorUp(swicthCdTime);
            //}
        }
        private void RefreshOSCEffect()
        {
            var _open = ModelCenter.Instance.GetModel<ImpactRankModel>().OSCEffectOpen;
            if (_open && !m_OSCEffect.IsPlaying)
            {
                m_OSCEffect.Play();
            }
            else if (!_open && m_OSCEffect.IsPlaying)
            {
                m_OSCEffect.StopImediatly();
            }
        }
        private void OnStoreFuncOpen()
        {
            RefreshStoreEffect();
        }
        private void RefreshStoreEffect()
        {
            storeDesBtn.gameObject.SetActive(false);
            int limitLv = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("MallPush").Numerical1);
            if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)
                || PlayerDatas.Instance.baseData.LV < limitLv)
                return;
            List<StoreConfig> shoplist = ModelCenter.Instance.GetModel<StoreModel>().shoplist;
            if (shoplist.Count > 0 && !m_StoreEffect.IsPlaying)
            {
                if (isNeedTip)
                {
                    storeDesBtn.gameObject.SetActive(true);
                    isNeedTip = false;
                    if (this.gameObject.activeInHierarchy)
                    {
                        StartCoroutine(DelayHideStoreDes());
                    }
                }
                m_StoreEffect.Play();
            }
            else if (shoplist.Count <= 0 && m_StoreEffect.IsPlaying)
            {
                m_StoreEffect.StopImediatly();
            }
        }
        IEnumerator DelayHideStoreDes()
        {
            yield return new WaitForSeconds(5);
            storeDesBtn.gameObject.SetActive(false);
        }
        private void SwithButtonObj()
        {
            if (!PreFightMission.Instance.IsFinished())
            {
                return;
            }
            if (m_HighSettingFadeInFadeOut.IsShowButton())
            {
                m_HighSettingShow.SetActive(true);
            }
            else
            {
                m_HighSettingShow.SetActive(false);
            }
        }
    }
}
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Friday, September 08, 2017
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using TableConfig;
using System;
using System.Collections.Generic;
//顶层面板框按钮
namespace Snxxz.UI
{
    public class HighSettingTip : MonoBehaviour
    {
        [SerializeField] Button _DaTreasureBtn;//打宝按钮
        [SerializeField] Button m_LootPrecious;//夺宝
        [SerializeField] Button _MarketBtn;//市场按钮
        [SerializeField] Button _ShoppingBtn;//商城按钮
        [SerializeField] Button _RechargeBtn;//充值按钮
        [SerializeField] Button _WelfareBtn;//福利按钮
        [SerializeField] Button _TreasureBtn;//寻宝按钮
        [SerializeField] Button m_OpenService;//开服活动按钮
        [SerializeField] Button _RuneTaBtn;//符印按钮
        [SerializeField] Image m_OpenServerTitle;
        [SerializeField] Transform m_HighSettingTip;//判定
        [SerializeField] GameObject m_HighSettingShow;//是否开启切换功能
        [SerializeField] Button _ShowBtn;//切换按钮1
        [SerializeField] Button _ColseBtn;//切换按钮2
        [SerializeField] UIEffect m_OSCEffect;//开服活动特效
        [SerializeField] UIEffect m_StoreEffect;//商城特效
        [SerializeField] Button storeDesBtn;  //商城活动描述信息
        [SerializeField] HighSettingFadeInFadeOut m_HighSettingFadeInFadeOut;
        [SerializeField] Button m_Treasure;//法宝入口
        [SerializeField] Button m_HappyXBBtn;//寻宝入口
        [SerializeField] Button m_FindHostBtn;//仙宝寻主
        [SerializeField] RechargeBtnBehaviour m_RechargetBtnBehaviour;
        [SerializeField] Button m_OSGiftBtn;
        [SerializeField] Button m_LimitedTimePBtn;//限时礼包
        [SerializeField] Button m_ElfFestivalBtn;//仙界盛典
        private bool _bool = true;
        private int swicthCdTime = 0;
        private bool IsFadeOut = true;
        private bool isNeedTip = true;
        StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
        OSGiftModel osGiftModel { get { return ModelCenter.Instance.GetModel<OSGiftModel>(); } }
        PlayerMainDate mainModel { get { return ModelCenter.Instance.GetModel<PlayerMainDate>(); } }
        private void Start()
        {
            isNeedTip = true;
        }
        public void Init()
        {
            swicthCdTime = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("AutomaticSwitch").Numerical1);
            OpenServerActivityStateChange();
            CheckOSGift();
            m_RechargetBtnBehaviour.Init();
            m_HighSettingFadeInFadeOut.Init();
            storeDesBtn.AddListener(() => { storeDesBtn.gameObject.SetActive(false); });
            m_LootPrecious.AddListener(LootPreciousButton);
            _MarketBtn.AddListener(MarketButton);
            _ShoppingBtn.AddListener(ShoppingButton);
            _TreasureBtn.AddListener(TreasureButton);
            _WelfareBtn.AddListener(WelfareButton);
            _DaTreasureBtn.AddListener(DaTreasureButton);
            _RechargeBtn.AddListener(RechargeButton);
            m_Treasure.AddListener(OpenTreasure);
            _ShowBtn.AddListener(ShowButton);
            _ColseBtn.AddListener(ColseButton);
            m_HappyXBBtn.AddListener(OnClickHappyXBBtn);
            m_FindHostBtn.AddListener(OnClickFindHostBtn);
            m_OpenService.AddListener(OpenService);
            m_OSGiftBtn.AddListener(OSGiftBtn);
            _RuneTaBtn.onClick.AddListener(RuneTaButton);
            m_LimitedTimePBtn.AddListener(OnCliCkLimitedTimePBtn);
            m_ElfFestivalBtn.AddListener(OnClickElfFestivalBtn);
            if (_bool)
            {
                ColseButton();
            }
            if (_ColseBtn.gameObject.activeSelf)
            {
                CoroutineMgr.Instance.OnMainStartCorUp(swicthCdTime);
            }
            CoroutineMgr.Instance.MainHighTipCdTimeEvent += OnMainHighTipCdTime;
            FunctionUnlockFlyObjectTarget.IsPlayerUiEffect += IsPlayerUiEffect;
            osGiftModel.OnOSGiftStateChange += CheckOSGift;
            storeModel.StoreFuncOpenAct += OnStoreFuncOpen;
            OpenServerActivityCenter.Instance.openServerActivityStateChange += OpenServerActivityStateChange;
        }
        public void OnActived()
        {
            if (_ColseBtn.gameObject.activeInHierarchy)
            {
                m_HighSettingFadeInFadeOut.PositionNow();
            }
            else
            {
                if (mainModel.IsRedPointShowPanel())
                {
                    ShowButtonNow();
                }
                else
                {
                    m_HighSettingFadeInFadeOut.PositionDel();
                }
            }
        }
        public void UnInit()
        {
            m_LootPrecious.RemoveAllListeners();
            _MarketBtn.RemoveAllListeners();
            _ShoppingBtn.RemoveAllListeners();
            _TreasureBtn.RemoveAllListeners();
            _WelfareBtn.RemoveAllListeners();
            _DaTreasureBtn.RemoveAllListeners();
            _RechargeBtn.RemoveAllListeners();
            m_Treasure.RemoveAllListeners();
            _ShowBtn.RemoveAllListeners();
            _ColseBtn.RemoveAllListeners();
            m_OpenService.RemoveAllListeners();
            m_HappyXBBtn.RemoveAllListeners();
            m_FindHostBtn.RemoveAllListeners();
            m_OSGiftBtn.RemoveAllListeners();
            m_LimitedTimePBtn.RemoveAllListeners();
            _RuneTaBtn.onClick.RemoveAllListeners();
            CoroutineMgr.Instance.MainHighTipCdTimeEvent -= OnMainHighTipCdTime;
            FunctionUnlockFlyObjectTarget.IsPlayerUiEffect -= IsPlayerUiEffect;
            FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChange;
            storeModel.StoreFuncOpenAct -= OnStoreFuncOpen;
            osGiftModel.OnOSGiftStateChange -= CheckOSGift;
            OpenServerActivityCenter.Instance.openServerActivityStateChange -= OpenServerActivityStateChange;
            CoroutineMgr.Instance.OnMainStopCorUP();
            m_HighSettingFadeInFadeOut.Unit();
            m_RechargetBtnBehaviour.UnInit();
        }
        private void OnFuncStateChange(int obj)
        {
            if (this.gameObject.activeInHierarchy)
            {
                StartCoroutine(DelayFrame());
            }
        }
        IEnumerator DelayFrame()
        {
            yield return WaitingForSecondConst.WaitMS200;
            SwithButtonObj();
        }
        public void AfterOpen()
        {
            FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChange;
            SwithButtonObj();
            RefreshOSCEffect();
            RefreshStoreEffect();
        }
        private void OnDisable()
        {
            StopCoroutine(DelayHideStoreDes());
        }
        private void IsPlayerUiEffect()
        {
            if (NewBieCenter.Instance.inGuiding)
            {
                return;
            }
            if (!m_HighSettingFadeInFadeOut.GetIsFadeIn())
            {
                m_HighSettingFadeInFadeOut.PositionDel();//立刻隐藏
            }
        }
        private void OpenServerActivityStateChange()
        {
            int _order = 0;
            m_OpenService.gameObject.SetActive(OpenServerActivityCenter.Instance.IsAnyActivityOpen(out _order));
            //m_OpenServerTitle.SetSprite(OpenServerActivityCenter.Instance.IsFlashSaleTitle() ? "WZ_ZJM_29" : "W_HuoDong");
        }
        private void OnMainHighTipCdTime()
        {
            ColseButton();
        }
        void MarketButton()//市场按钮
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<MarketWin>();
        }
        void OpenService()//开服活动
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<OpenServerActivityWin>();
        }
        void ShoppingButton()//商城按钮
        {
            if (FuncOpen.Instance.IsFuncOpen(79))
            {
                WindowCenter.Instance.Close<MainInterfaceWin>();
                WindowCenter.Instance.Open<StoreWin>();
            }
            else
            {
                SysNotifyMgr.Instance.ShowTip("UnopenedFunction");
            }
        }
        void TreasureButton()//寻宝按钮
        {
        }
        void WelfareButton()//福利按钮
        {
            WelfareCenter.Instance.OpenWelfare();
        }
        void DaTreasureButton()//打宝按钮
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<FindPreciousFrameWin>();
        }
        void LootPreciousButton()//夺宝
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<LootPreciousFrameWin>();
        }
        void RechargeButton()//充值按钮
        {
            if (VersionConfig.Get().isBanShu)
            {
                SysNotifyMgr.Instance.ShowTip("FuncNoOpen_Nowaday");
                return;
            }
            switch (m_RechargetBtnBehaviour.state)
            {
                case 1:
                    if (!NewBieCenter.Instance.inGuiding)
                    {
                        WindowCenter.Instance.Close<MainInterfaceWin>();
                        WindowCenter.Instance.Open<FirstRechargeWin>(true);
                    }
                    break;
                //case 2:
                //    WindowCenter.Instance.Open<OpenServerGiftWin>();
                //    break;
                case 3:
                    WindowCenter.Instance.Close<MainInterfaceWin>();
                    WindowCenter.Instance.Open<VipRechargeWin>(false, 0);
                    break;
            }
        }
        private void OSGiftBtn()
        {
            if (osGiftModel.giftGetNotify)
            {
                osGiftModel.giftGetNotify = false;
            }
            WindowCenter.Instance.Open<OpenServerGiftWin>();
        }
        void RuneTaButton()//符印塔
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<RuneTowerWin>();
        }
        private void CheckOSGift()
        {
            m_OSGiftBtn.gameObject.SetActive(osGiftModel.activate);
            SwithButtonObj();
        }
        void OpenTreasure()
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            var _model = ModelCenter.Instance.GetModel<TreasureModel>();
            if (_model.GetTreasureUnlockShow(TreasureCategory.Human) != 0)
            {
                _model.currentCategory = TreasureCategory.Human;
            }
            WindowCenter.Instance.Open<TreasureSelectWin>();
        }
        void OnClickHappyXBBtn()//寻宝
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<HappyXBWin>();
        }
        void OnClickFindHostBtn()//仙宝寻主
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<TreasureFindHostWin>();
        }
        void OnCliCkLimitedTimePBtn()//限时礼包
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<LimitedTimePackageWin>();
        }
        void OnClickElfFestivalBtn()
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<FairylandCeremonyWin>();
        }
        public void ShowButton()//向上
        {
            _ColseBtn.gameObject.SetActive(true);
            _ShowBtn.gameObject.SetActive(false);
            if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>() && m_HighSettingTip.gameObject.activeSelf)
            {
                m_HighSettingFadeInFadeOut.FadeOut();//淡出
            }
            CoroutineMgr.Instance.OnMainStartCorUp(swicthCdTime);
        }
        public void ColseButton()//向下
        {
            if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>() && m_HighSettingTip.gameObject.activeSelf)
            {
                _ShowBtn.gameObject.SetActive(true);
                _ColseBtn.gameObject.SetActive(false);
                m_HighSettingFadeInFadeOut.FadeIn();//淡入
                _bool = false;
                CoroutineMgr.Instance.OnMainStopCorUP();
            }
        }
        public void ColseButtonNow()//向下(立刻隐藏)
        {
            if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>() && m_HighSettingTip.gameObject.activeSelf)
            {
                _ShowBtn.gameObject.SetActive(true);
                _ColseBtn.gameObject.SetActive(false);
                m_HighSettingFadeInFadeOut.PositionDel();//立刻隐藏
                _bool = false;
                CoroutineMgr.Instance.OnMainStopCorUP();
            }
        }
        public void ShowButtonNow()//向上(立刻出现)
        {
            _ColseBtn.gameObject.SetActive(true);
            _ShowBtn.gameObject.SetActive(false);
            if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>() && m_HighSettingTip.gameObject.activeSelf)
            {
                m_HighSettingFadeInFadeOut.PositionNow();//立刻出现
            }
            //if (!mainModel.IsRedPointShowPanel())
            //{
            //    CoroutineMgr.Instance.OnMainStartCorUp(swicthCdTime);
            //}
        }
        private void RefreshOSCEffect()
        {
            var _open = ModelCenter.Instance.GetModel<ImpactRankModel>().OSCEffectOpen;
            if (_open && !m_OSCEffect.IsPlaying)
            {
                m_OSCEffect.Play();
            }
            else if (!_open && m_OSCEffect.IsPlaying)
            {
                m_OSCEffect.StopImediatly();
            }
        }
        private void OnStoreFuncOpen()
        {
            RefreshStoreEffect();
        }
        private void RefreshStoreEffect()
        {
            storeDesBtn.gameObject.SetActive(false);
            int limitLv = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("MallPush").Numerical1);
            if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)
                || PlayerDatas.Instance.baseData.LV < limitLv)
                return;
            List<StoreConfig> shoplist = ModelCenter.Instance.GetModel<StoreModel>().shoplist;
            if (shoplist.Count > 0 && !m_StoreEffect.IsPlaying)
            {
                if (isNeedTip)
                {
                    storeDesBtn.gameObject.SetActive(true);
                    isNeedTip = false;
                    if (this.gameObject.activeInHierarchy)
                    {
                        StartCoroutine(DelayHideStoreDes());
                    }
                }
                m_StoreEffect.Play();
            }
            else if (shoplist.Count <= 0 && m_StoreEffect.IsPlaying)
            {
                m_StoreEffect.StopImediatly();
            }
        }
        IEnumerator DelayHideStoreDes()
        {
            yield return new WaitForSeconds(5);
            storeDesBtn.gameObject.SetActive(false);
        }
        private void SwithButtonObj()
        {
            if (!PreFightMission.Instance.IsFinished())
            {
                return;
            }
            if (m_HighSettingFadeInFadeOut.IsShowButton())
            {
                m_HighSettingShow.SetActive(true);
            }
            else
            {
                m_HighSettingShow.SetActive(false);
            }
        }
    }
}