ABPathWrap.cs 982 B

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