NoticeSystemShowView.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using UnityEngine;
  2. using FairyGUI;
  3. using UI.Notice;
  4. namespace GFGGame
  5. {
  6. public class NoticeSystemShowView : BaseWindow
  7. {
  8. private UI_NoticeSystemShowUI _ui;
  9. public override void Dispose()
  10. {
  11. if (_ui != null)
  12. {
  13. _ui.Dispose();
  14. _ui = null;
  15. }
  16. base.Dispose();
  17. }
  18. protected override void Init()
  19. {
  20. base.Init();
  21. packageName = UI_NoticeSystemShowUI.PACKAGE_NAME;
  22. _ui = UI_NoticeSystemShowUI.Create();
  23. this.viewCom = _ui.target;
  24. isfullScreen = true;
  25. this.clickBlankToClose = false;
  26. // this.modal = true;
  27. // viewAnimationType = EnumViewAnimationType.None;
  28. }
  29. protected override void OnInit()
  30. {
  31. base.OnInit();
  32. _ui.m_btnBack.onClick.Add(GoBackFrom);
  33. _ui.m_btnBg.onClick.Add(GoBackFrom);
  34. }
  35. protected override void OnShown()
  36. {
  37. base.OnShown();
  38. NoticeInfo noticeInfo = this.viewData as NoticeInfo;
  39. _ui.m_txtTitle.text = noticeInfo.title;
  40. _ui.m_ComContent.m_txtContent.text = noticeInfo.content;
  41. }
  42. protected override void OnHide()
  43. {
  44. base.OnHide();
  45. }
  46. private void GoBackFrom()
  47. {
  48. ViewManager.GoBackFrom(typeof(NoticeSystemShowView).Name);
  49. }
  50. }
  51. }