StudioView.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using UI.Studio;
  2. using UnityEngine;
  3. namespace GFGGame
  4. {
  5. public class StudioView : BaseWindow
  6. {
  7. private UI_StudioUI _ui;
  8. public override void Dispose()
  9. {
  10. base.Dispose();
  11. }
  12. protected override void OnInit()
  13. {
  14. base.OnInit();
  15. packageName = UI_StudioUI.PACKAGE_NAME;
  16. _ui = UI_StudioUI.Create();
  17. this.viewCom = _ui.target;
  18. isfullScreen = true;
  19. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  20. _ui.m_comMetal.target.onClick.Add(OnClickComMetal);
  21. _ui.m_comFabric.target.onClick.Add(OnCliclComFabric);
  22. _ui.m_comProperty.target.onClick.Add(OnComProperty);
  23. _ui.m_comFiling.target.onClick.Add(OnClickComFilling);
  24. }
  25. protected override void OnShown()
  26. {
  27. base.OnShown();//1;//
  28. StudioSProxy.ReqStudioInfos().Coroutine();
  29. int isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioMetalView).FullName, false) ? 1 : 0;
  30. _ui.m_comMetal.m_c1.selectedIndex = isopen;
  31. isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioFabricView).FullName, false) ? 1 : 0; ;
  32. _ui.m_comFabric.m_c1.selectedIndex = isopen;
  33. isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioPropertyView).FullName, false) ? 1 : 0;
  34. _ui.m_comProperty.m_c1.selectedIndex = isopen;
  35. }
  36. protected override void OnHide()
  37. {
  38. base.OnHide();
  39. }
  40. private void OnClickBtnBack()
  41. {
  42. ViewManager.GoBackFrom(typeof(StudioView).FullName);
  43. }
  44. private void OnClickComMetal()
  45. {
  46. if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioMetalView).FullName, true)) return;
  47. ViewManager.Show<StudioMetalView>(new object[] { 0, 0 }, new object[] { typeof(StudioView).Name, this.viewData });
  48. }
  49. private void OnCliclComFabric()
  50. {
  51. if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioFabricView).FullName, true)) return;
  52. ViewManager.Show<StudioFabricView>(new object[] { 0, 0 }, new object[] { typeof(StudioView).Name, this.viewData });
  53. }
  54. private void OnComProperty()
  55. {
  56. if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioPropertyView).FullName, true)) return;
  57. ViewManager.Show<StudioPropertyView>(new object[] { 1, 0 }, new object[] { typeof(StudioView).Name, this.viewData });
  58. }
  59. private void OnClickComFilling()
  60. {
  61. }
  62. protected override void UpdateToCheckGuide(object param)
  63. {
  64. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  65. GuideController.TryGuide(_ui.target, ConstGuideId.STUDIO_OPEN, 2, "通关相应副本,可以获得各种升级材料哦,快开始今天的日常工作吧~~", -1, true, (int)(this.viewCom.height - 280), 0, 0, false, false);
  66. GuideController.TryCompleteGuide(ConstGuideId.STUDIO_OPEN, 2);
  67. }
  68. }
  69. }