| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 | 
using ET;using FairyGUI;using UI.Studio;using UnityEngine;using System.Collections.Generic;namespace GFGGame{    public class StudioView : BaseWindow    {        private UI_StudioUI _ui;        private EffectUI _effectUI1;        private EffectUI _effectUI2;        private EffectUI _effectUI3;        private EffectUI _effectUI4;        private EffectUI _effectUI5;        private Dictionary<string, UI_ComEctype> comEctypeDic = new Dictionary<string, UI_ComEctype>();        public override void Dispose()        {            EffectUIPool.Recycle(_effectUI1);            _effectUI1 = null;            EffectUIPool.Recycle(_effectUI2);            _effectUI2 = null;            EffectUIPool.Recycle(_effectUI3);            _effectUI3 = null;            EffectUIPool.Recycle(_effectUI4);            _effectUI4 = null;            EffectUIPool.Recycle(_effectUI5);            _effectUI5 = null;            if (_ui != null)            {                _ui.Dispose();                _ui = null;            }            base.Dispose();        }        protected override void OnInit()        {            base.OnInit();            packageName = UI_StudioUI.PACKAGE_NAME;            _ui = UI_StudioUI.Create();            this.viewCom = _ui.target;            isfullScreen = true;            isReturnView = true;            _ui.m_btnBack.onClick.Add(OnClickBtnBack);            _ui.m_btnHome.onClick.Add(OnClickBtnHome);            _ui.m_comMetal.target.onClick.Add(OnClickComMetal);            _ui.m_comFabric.target.onClick.Add(OnCliclComFabric);            _ui.m_comProperty.target.onClick.Add(OnComProperty);            _ui.m_comFiling.target.onClick.Add(OnClickComFilling);            _ui.m_comPorcelain.target.onClick.Add(OnComPorceLain);            comEctypeDic.Add(typeof(StudioMetalView).FullName, _ui.m_comMetal);            comEctypeDic.Add(typeof(StudioFabricView).FullName, _ui.m_comFabric);            comEctypeDic.Add(typeof(StudioPropertyView).FullName, _ui.m_comProperty);            comEctypeDic.Add(typeof(StudioFilingView).FullName, _ui.m_comFiling);            comEctypeDic.Add(typeof(StudioPorcelainView).FullName, _ui.m_comPorcelain);            _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_comFiling.m_effect, "ui_Small_parts", "YaJi_TuBiao");            _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_comMetal.m_effect, "ui_Small_parts", "YaJi_TuBiao");            _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_comFabric.m_effect, "ui_Small_parts", "YaJi_TuBiao");            _effectUI4 = EffectUIPool.CreateEffectUI(_ui.m_comProperty.m_effect, "ui_Small_parts", "YaJi_TuBiao");            _effectUI5 = EffectUIPool.CreateEffectUI(_ui.m_comPorcelain.m_effect, "ui_Small_parts", "YaJi_TuBiao");        }        protected override void AddEventListener()        {            base.AddEventListener();            EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);        }        protected override void OnShown()        {            base.OnShown();//1;//            StudioSProxy.ReqStudioInfos().Coroutine();            //int isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioMetalView).FullName, false) ? 1 : 0;            //_ui.m_comMetal.m_c1.selectedIndex = isopen;            //isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioFabricView).FullName, false) ? 1 : 0; ;            //_ui.m_comFabric.m_c1.selectedIndex = isopen;            //isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioPropertyView).FullName, false) ? 1 : 0;            //_ui.m_comProperty.m_c1.selectedIndex = isopen;            //isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioFilingView).FullName, false) ? 1 : 0;            //_ui.m_comFiling.m_c1.selectedIndex = isopen;            //isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioPorcelainView).FullName, false) ? 1 : 0;            //_ui.m_comPorcelain.m_c1.selectedIndex = isopen;            int isopen = 1;            foreach(var com in comEctypeDic)            {                isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(com.Key, false) ? 1 : 0;                com.Value.m_c1.selectedIndex = isopen;                if(isopen == 0)                {                    com.Value.m_effect.visible = false;                    com.Value.m_bg.visible = true;                }                else                {                    com.Value.m_bg.visible = false;                    com.Value.m_t0.Play();                    com.Value.m_effect.visible = true;                }            }            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("ejzjm_bj");            UpdateRedDot();            Timers.inst.AddUpdate(CheckGuide);        }        protected override void OnHide()        {            base.OnHide();            TryCompleteGuide();            Timers.inst.Remove(CheckGuide);        }        private void OnClickBtnHome()        {            GameController.GoBackToMainView();        }        protected override void RemoveEventListener()        {            base.RemoveEventListener();            EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);        }        private void OnClickBtnBack()        {            ViewManager.GoBackFrom(typeof(StudioView).FullName);        }        private void OnClickComMetal()        {            LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.JIN_SHU_XIU_FU, 1);            if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioMetalView).FullName, true)) return;            ViewManager.Show<StudioMetalView>();            this.Hide();        }        private void OnCliclComFabric()        {            LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZHI_WU_XIU_FU, 1);            if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioFabricView).FullName, true)) return;            ViewManager.Show<StudioFabricView>();            this.Hide();        }        private void OnComProperty()        {            //LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHU_HUA_XIU_FU, 1);            if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioPropertyView).FullName, true)) return;            ViewManager.Show<StudioPropertyView>();            this.Hide();        }        private void OnComPorceLain()        {            // LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHU_HUA_XIU_FU, 1);            if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioPorcelainView).FullName, true)) return;            ViewManager.Show<StudioPorcelainView>();            this.Hide();        }        private void OnClickComFilling()        {            ViewManager.Show<StudioFilingView>(StudioDataManager.Instance.npcFilingChapterId);        }        private void UpdateRedDot()        {            RedDotController.Instance.SetComRedDot(_ui.m_comFiling.target, RedDotDataManager.Instance.GetStudioFilingRed(), "", 10, 24);        }        private void CheckGuide(object param)        {            if (GuideDataManager.IsGuideFinish(ConstGuideId.STUDIO_PORCELAIN) <= 0            //|| GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER_4) <= 0            || GuideDataManager.IsGuideFinish(ConstGuideId.STUDIO_PROPERTY) <= 0            || GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER_2) <= 0            || GuideDataManager.IsGuideFinish(ConstGuideId.STUDIO_FILING) <= 0)            {                UpdateToCheckGuide(null);            }            else            {                Timers.inst.Remove(CheckGuide);            }        }        protected override void UpdateToCheckGuide(object param)        {            if (!ViewManager.CheckIsTopView(this.viewCom)) return;            GuideController.TryGuide(_ui.m_comPorcelain.target, ConstGuideId.STUDIO_PORCELAIN, 4, "通关这个副本可以获得词牌升级材料,快去挑战吧。");            GuideController.TryGuide(_ui.m_comFiling.target, ConstGuideId.STUDIO_FILING, 4, "完成小伙伴的心愿,获得合成服饰的必备材料哦。");            GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.ENTER_CHAPTER_2, 1, "");            GuideController.TryGuide(_ui.m_comPorcelain.target, ConstGuideId.STUDIO_PORCELAIN, 4, "通关这个副本可以获得词牌升级材料,快去挑战吧。");            GuideController.TryGuide(_ui.m_comProperty.target, ConstGuideId.STUDIO_PROPERTY, 3, "");            GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.STUDIO_PROPERTY,7);            GuideController.TryCompleteGuide(ConstGuideId.STUDIO_PROPERTY, 7);            //GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.ENTER_CHAPTER_4, 1, "");        }        protected override void TryCompleteGuide()        {            base.TryCompleteGuide();            GuideController.TryCompleteGuideIndex(ConstGuideId.STUDIO_PROPERTY, 7);            GuideController.TryCompleteGuide(ConstGuideId.STUDIO_PROPERTY, 7);        }    }}
 |