NoticeSystemShowView.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. _ui.m_ComContent.target.scrollPane.ScrollTop();
  42. }
  43. protected override void OnHide()
  44. {
  45. base.OnHide();
  46. }
  47. private void GoBackFrom()
  48. {
  49. ViewManager.GoBackFrom(typeof(NoticeSystemShowView).Name);
  50. ViewManager.Show<NoticeView>();
  51. }
  52. }
  53. }