UIComponent.cs 541 B

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