UnitComponentSystem.cs 452 B

123456789101112131415161718
  1. namespace ET
  2. {
  3. [FriendOfAttribute(typeof(ET.UnitComponent))]
  4. public static class UnitComponentSystem
  5. {
  6. public static Unit Get(this UnitComponent self, long id)
  7. {
  8. Unit unit = self.GetChild<Unit>(id);
  9. return unit;
  10. }
  11. public static void Remove(this UnitComponent self, long id)
  12. {
  13. Unit unit = self.GetChild<Unit>(id);
  14. unit?.Dispose();
  15. }
  16. }
  17. }