UIComponent.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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.AddAsync(NodeKeys.Partners);
  15. Context.Tree.AddAsync(NodeKeys.DragonEgg);
  16. Context.Tree.Remove(NodeKeys.Login, true);
  17. }
  18. public override void OnDisable()
  19. {
  20. Context.UI.Close(UIKeys.MainHomePanel);
  21. Context.UI.Close(UIKeys.MainHomeBottomPanel);
  22. Context.UI.Close(UIKeys.CommonToastPanel);
  23. Context.Tree.Remove(NodeKeys.Partners);
  24. Context.Tree.Remove(NodeKeys.DragonEgg);
  25. }
  26. void ILoadAsyncHandle.OnLoadAsync(IAsyncGroup group)
  27. {
  28. Context.UI.Preload(UINestedKeys.CommonItemBase).Join(group);
  29. }
  30. void ILoadAsyncHandle.OnUnloadAsync(IAsyncGroup group)
  31. {
  32. }
  33. }
  34. }