UIComponent.cs 978 B

123456789101112131415161718192021222324252627282930313233
  1. using FL.FGUI;
  2. using XGame.Framework.Asyncs;
  3. using XGame.Framework.FGUI;
  4. using XGame.Framework.Loadable;
  5. using XGame.Framework.Nodes;
  6. namespace FL.Nodes.GameMain
  7. {
  8. public class UIComponent : NodeComponent, ILoadAsyncHandle
  9. {
  10. public override void OnEnable(object intent)
  11. {
  12. Context.UI.OpenAsync(UIKeys.MainHomePanel, "打开MainHomePanel");
  13. Context.UI.OpenAsync(UIKeys.MainHomeBottomPanel);
  14. Context.Tree.Remove(NodeKeys.Login, true);
  15. }
  16. public override void OnDisable()
  17. {
  18. Context.UI.Close(UIKeys.MainHomePanel);
  19. Context.UI.Close(UIKeys.MainHomeBottomPanel);
  20. Context.UI.Close(UIKeys.CommonToastPanel);
  21. }
  22. void ILoadAsyncHandle.OnLoadAsync(IAsyncGroup group)
  23. {
  24. Context.UI.Preload(UINestedKeys.CommonItemBase).Join(group);
  25. }
  26. void ILoadAsyncHandle.OnUnloadAsync(IAsyncGroup group)
  27. {
  28. }
  29. }
  30. }