PoemView.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using ET;
  2. using FairyGUI;
  3. using UI.Poem;
  4. using UnityEngine;
  5. namespace GFGGame
  6. {
  7. public class PoemView : BaseWindow
  8. {
  9. private UI_PoemUI _ui;
  10. public override void Dispose()
  11. {
  12. if (_ui != null)
  13. {
  14. _ui.Dispose();
  15. _ui = null;
  16. }
  17. base.Dispose();
  18. }
  19. protected override void OnInit()
  20. {
  21. base.OnInit();
  22. packageName = UI_PoemUI.PACKAGE_NAME;
  23. _ui = UI_PoemUI.Create();
  24. this.viewCom = _ui.target;
  25. isfullScreen = true;
  26. _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zjm_11");
  27. _ui.m_btnback.onClick.Add(OnBtnBackClick);
  28. _ui.m_comphoto.target.onClick.Add(OnComPhotoClick);
  29. _ui.m_comGallery.target.onClick.Add(OnComGalleryClick);
  30. }
  31. protected override void AddEventListener()
  32. {
  33. base.AddEventListener();
  34. }
  35. protected override void OnShown()
  36. {
  37. base.OnShown();
  38. _ui.m_comphoto.m_c1.selectedIndex = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(PoemPhotoView).Name) ? 1 : 0;
  39. _ui.m_comGallery.m_c1.selectedIndex = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(PoemGalleryView).Name) ? 1 : 0;
  40. }
  41. protected override void OnHide()
  42. {
  43. base.OnHide();
  44. }
  45. protected override void RemoveEventListener()
  46. {
  47. base.RemoveEventListener();
  48. }
  49. private void OnBtnBackClick()
  50. {
  51. ViewManager.GoBackFrom(typeof(PoemView).FullName);
  52. }
  53. private void OnComPhotoClick()
  54. {
  55. ViewManager.Show<PoemPhotoView>(null, new object[] { typeof(PoemView).FullName, this.viewData });
  56. }
  57. private void OnComGalleryClick()
  58. {
  59. ViewManager.Show<PoemGalleryView>(null, new object[] { typeof(PoemView).FullName, this.viewData });
  60. }
  61. }
  62. }