using ET; using FairyGUI; using UI.Studio; using UnityEngine; namespace GFGGame { public class StudioView : BaseWindow { private UI_StudioUI _ui; public override void Dispose() { 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; _ui.m_btnBack.onClick.Add(OnClickBtnBack); _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); } 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; _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("ejzjm_bj"); Timers.inst.AddUpdate(CheckGuide); } protected override void OnHide() { base.OnHide(); TryCompleteGuide(); Timers.inst.Remove(CheckGuide); } private void OnClickBtnBack() { ViewManager.GoBackFrom(typeof(StudioView).FullName); } private void OnClickComMetal() { LogServerHelper.SendNodeLog((int)PlayParticipationEnum.JIN_SHU_XIU_FU, 1); if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioMetalView).FullName, true)) return; ViewManager.Show(new object[] { 0, 0 }, new object[] { typeof(StudioView).FullName, this.viewData }); this.Hide(); } private void OnCliclComFabric() { LogServerHelper.SendNodeLog((int)PlayParticipationEnum.ZHI_WU_XIU_FU, 1); if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioFabricView).FullName, true)) return; ViewManager.Show(new object[] { 0, 0 }, new object[] { typeof(StudioView).FullName, this.viewData }); this.Hide(); } private void OnComProperty() { LogServerHelper.SendNodeLog((int)PlayParticipationEnum.SHU_HUA_XIU_FU, 1); if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioPropertyView).FullName, true)) return; ViewManager.Show(new object[] { 1, 0 }, new object[] { typeof(StudioView).FullName, this.viewData }); this.Hide(); } private void OnClickComFilling() { } private void CheckGuide(object param) { if (GuideDataManager.IsGuideFinish(ConstGuideId.STUDIO_OPEN) <= 0) { UpdateToCheckGuide(null); } else { Timers.inst.Remove(CheckGuide); } } protected override void UpdateToCheckGuide(object param) { if (!ViewManager.CheckIsTopView(this.viewCom)) return; GuideController.TryGuide(_ui.target, ConstGuideId.STUDIO_OPEN, 2, "通关相应副本,可以获得各种升级材料哦,快开始今天的日常工作吧。", -1, true, (int)(this.viewCom.height - 280), 0, 0, false, false); GuideController.TryCompleteGuide(ConstGuideId.STUDIO_OPEN, 2); } protected override void TryCompleteGuide() { GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.STUDIO_OPEN); GuideController.TryCompleteGuideIndex(cfg.id, 2); GuideController.TryCompleteGuide(ConstGuideId.STUDIO_OPEN, 2); } } }