UIComponent.cs 542 B

12345678910111213141516171819202122
  1. using FL.FGUI;
  2. using XGame.Framework.Nodes;
  3. namespace FL.Nodes.Mail
  4. {
  5. public class UIComponent : NodeComponent
  6. {
  7. public override void OnEnable(object intent)
  8. {
  9. Context.AddListener(EventDefine.OpenMailUI, OpenMailUI);
  10. }
  11. public override void OnDisable()
  12. {
  13. Context.RemoveListener(EventDefine.OpenMailUI, OpenMailUI);
  14. }
  15. private void OpenMailUI(int eventId, object args)
  16. {
  17. Context.UI.OpenAsync(UIKeys.MailMailPanel);
  18. }
  19. }
  20. }