UnitComponentSystem.cs 700 B

12345678910111213141516171819202122232425262728293031323334353637
  1. namespace ET
  2. {
  3. [ObjectSystem]
  4. public class UnitComponentAwakeSystem : AwakeSystem<UnitComponent>
  5. {
  6. protected override void Awake(UnitComponent self)
  7. {
  8. }
  9. }
  10. [ObjectSystem]
  11. public class UnitComponentDestroySystem : DestroySystem<UnitComponent>
  12. {
  13. protected override void Destroy(UnitComponent self)
  14. {
  15. }
  16. }
  17. public static class UnitComponentSystem
  18. {
  19. public static void Add(this UnitComponent self, Unit unit)
  20. {
  21. }
  22. public static Unit Get(this UnitComponent self, long id)
  23. {
  24. Unit unit = self.GetChild<Unit>(id);
  25. return unit;
  26. }
  27. public static void Remove(this UnitComponent self, long id)
  28. {
  29. Unit unit = self.GetChild<Unit>(id);
  30. unit?.Dispose();
  31. }
  32. }
  33. }