PoemView.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_1");
  27. _ui.m_btnback.onClick.Add(OnBtnBackClick);
  28. _ui.m_comphoto.target.onClick.Add(OnComPhotoClick);
  29. }
  30. protected override void AddEventListener()
  31. {
  32. base.AddEventListener();
  33. }
  34. protected override void OnShown()
  35. {
  36. base.OnShown();
  37. _ui.m_comphoto.m_c1.selectedIndex = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(PoemPhotoView).Name) ? 1 : 0;
  38. }
  39. protected override void OnHide()
  40. {
  41. base.OnHide();
  42. }
  43. protected override void RemoveEventListener()
  44. {
  45. base.RemoveEventListener();
  46. }
  47. private void OnBtnBackClick()
  48. {
  49. ViewManager.GoBackFrom(typeof(PoemView).FullName);
  50. }
  51. private void OnComPhotoClick()
  52. {
  53. ViewManager.Show<PoemPhotoView>(null, new object[] { typeof(PoemView).FullName, this.viewData });
  54. }
  55. }
  56. }