RuleView.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System.Collections;
  2. using UnityEngine;
  3. using UI.CommonGame;
  4. using FairyGUI;
  5. using System.Collections.Generic;
  6. using System;
  7. namespace GFGGame
  8. {
  9. public class RuleView : BaseWindow
  10. {
  11. private UI_RuleUI _ui;
  12. public override void Dispose()
  13. {
  14. if (_ui != null)
  15. {
  16. _ui.Dispose();
  17. _ui = null;
  18. }
  19. base.Dispose();
  20. }
  21. protected override void OnInit()
  22. {
  23. base.OnInit();
  24. _ui = UI_RuleUI.Create();
  25. this.viewCom = _ui.target;
  26. this.viewCom.Center();
  27. this.modal = true;
  28. }
  29. protected override void OnShown()
  30. {
  31. base.OnShown();
  32. int id = (int)this.viewData;
  33. string content = TextDescArray.Instance.GetCfg(id).text;
  34. _ui.m_comContent.m_txtContent.text = content;
  35. ViewManager.SetMaskAlpha(0.8f);
  36. }
  37. protected override void OnHide()
  38. {
  39. base.OnHide();
  40. ViewManager.SetMaskAlpha(0.6f);
  41. }
  42. }
  43. }