ABPathWrap.cs 963 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections.Generic;
  2. using PF;
  3. namespace ETModel
  4. {
  5. [ObjectSystem]
  6. public class ABPathAwakeSystem : AwakeSystem<ABPathWrap, Vector3, Vector3>
  7. {
  8. public override void Awake(ABPathWrap self, Vector3 start, Vector3 end)
  9. {
  10. self.Awake(start, end);
  11. }
  12. }
  13. public class ABPathWrap: Component
  14. {
  15. public ABPath Path { get; private set; }
  16. public void Awake(Vector3 start, Vector3 end)
  17. {
  18. this.Path = ABPath.Construct(start, end);
  19. this.Path.Claim(this);
  20. }
  21. public List<Vector3> Result
  22. {
  23. get
  24. {
  25. return this.Path.vectorPath;
  26. }
  27. }
  28. public override void Dispose()
  29. {
  30. if (this.IsDisposed)
  31. {
  32. return;
  33. }
  34. base.Dispose();
  35. this.Path.Release(this);
  36. }
  37. }
  38. }