TableComponent.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using XGame.Database;
  2. using XGame.Framework.Asyncs;
  3. using XGame.Framework.Loadable;
  4. using XGame.Framework.Nodes;
  5. namespace FL.Nodes.GameMain
  6. {
  7. public class TableComponent : NodeComponent, ILoadAsyncHandle
  8. {
  9. public override void OnDisable()
  10. {
  11. Context.Tree.Remove(NodeKeys.Partners);
  12. Context.Tree.Remove(NodeKeys.DragonEgg);
  13. }
  14. public override void OnEnable(object intent)
  15. {
  16. Context.Tree.AddAsync(NodeKeys.Partners);
  17. Context.Tree.AddAsync(NodeKeys.DragonEgg);
  18. }
  19. void ILoadAsyncHandle.OnLoadAsync(IAsyncGroup group)
  20. {
  21. ChapterTableRepo.LoadAsync().Join(group);
  22. MapTableRepo.LoadAsync().Join(group);
  23. MonsterTableRepo.LoadAsync().Join(group);
  24. PartnerTableRepo.LoadAsync().Join(group);
  25. partnerStarUpTableRepo.LoadAsync().Join(group);
  26. partnerLvUpTableRepo.LoadAsync().Join(group);
  27. SkillTableRepo.LoadAsync().Join(group);
  28. SkillVfxsTableRepo.LoadAsync().Join(group);
  29. BuffTableRepo.LoadAsync().Join(group);
  30. EquipmentTableRepo.LoadAsync().Join(group);
  31. EquipmentBaseAttrTableRepo.LoadAsync().Join(group);
  32. EquipmentDisassemblyTableRepo.LoadAsync().Join(group);
  33. EquipmentDropTableRepo.LoadAsync().Join(group);
  34. EquipmentPeculiarAttrTableRepo.LoadAsync().Join(group);
  35. LevelTableRepo.LoadAsync().Join(group);
  36. AttrDescTableRepo.LoadAsync().Join(group);
  37. ItemTableRepo.LoadAsync().Join(group);
  38. EpigraphTableRepo.LoadAsync().Join(group);
  39. epigraphUpTableRepo.LoadAsync().Join(group);
  40. treasureTableRepo.LoadAsync().Join(group);
  41. treasureBonusTableRepo.LoadAsync().Join(group);
  42. DropTableRepo.LoadAsync().Join(group);
  43. }
  44. void ILoadAsyncHandle.OnUnloadAsync(IAsyncGroup group)
  45. {
  46. ChapterTableRepo.Unload();
  47. MapTableRepo.Unload();
  48. MonsterTableRepo.Unload();
  49. PartnerTableRepo.Unload();
  50. SkillTableRepo.Unload();
  51. SkillVfxsTableRepo.Unload();
  52. BuffTableRepo.Unload();
  53. EquipmentTableRepo.Unload();
  54. EquipmentBaseAttrTableRepo.Unload();
  55. EquipmentDisassemblyTableRepo.Unload();
  56. EquipmentDropTableRepo.Unload();
  57. EquipmentPeculiarAttrTableRepo.Unload();
  58. LevelTableRepo.Unload();
  59. ItemTableRepo.Unload();
  60. partnerLvUpTableRepo.Unload();
  61. AttrDescTableRepo.Unload();
  62. partnerStarUpTableRepo.Unload();
  63. DropTableRepo.Unload();
  64. treasureTableRepo.Unload();
  65. treasureBonusTableRepo.Unload();
  66. EpigraphTableRepo.Unload();
  67. }
  68. }
  69. }