RobotCaseComponentSystem.cs 967 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. namespace ET
  4. {
  5. [ObjectSystem]
  6. public class RobotCaseComponentAwakeSystem: AwakeSystem<RobotCaseComponent>
  7. {
  8. public override void Awake(RobotCaseComponent self)
  9. {
  10. RobotCaseComponent.Instance = self;
  11. }
  12. }
  13. [ObjectSystem]
  14. public class RobotCaseComponentDestroySystem: DestroySystem<RobotCaseComponent>
  15. {
  16. public override void Destroy(RobotCaseComponent self)
  17. {
  18. RobotCaseComponent.Instance = null;
  19. }
  20. }
  21. public static class RobotCaseComponentSystem
  22. {
  23. public static int GetN(this RobotCaseComponent self)
  24. {
  25. return ++self.N;
  26. }
  27. public static async ETTask<RobotCase> New(this RobotCaseComponent self)
  28. {
  29. await ETTask.CompletedTask;
  30. RobotCase robotCase = self.AddChild<RobotCase>();
  31. return robotCase;
  32. }
  33. }
  34. }