MoveComponent.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace ET
  5. {
  6. public class MoveComponent: Entity
  7. {
  8. public Vector3 PreTarget
  9. {
  10. get
  11. {
  12. return this.Targets[this.N - 1];
  13. }
  14. }
  15. public Vector3 NextTarget
  16. {
  17. get
  18. {
  19. return this.Targets[this.N];
  20. }
  21. }
  22. // 开启移动协程的时间
  23. public long BeginTime;
  24. // 每个点的开始时间
  25. public long StartTime { get; set; }
  26. // 开启移动协程的Unit的位置
  27. public Vector3 StartPos;
  28. public Vector3 RealPos
  29. {
  30. get
  31. {
  32. return this.Targets[0];
  33. }
  34. }
  35. private long needTime;
  36. public long NeedTime
  37. {
  38. get
  39. {
  40. return this.needTime;
  41. }
  42. set
  43. {
  44. this.needTime = value;
  45. }
  46. }
  47. public long MoveTimer;
  48. public float Speed; // m/s
  49. public Action<bool> Callback;
  50. public List<Vector3> Targets = new List<Vector3>();
  51. public Vector3 FinalTarget
  52. {
  53. get
  54. {
  55. return this.Targets[this.Targets.Count - 1];
  56. }
  57. }
  58. public int N;
  59. public int TurnTime;
  60. public bool IsTurnHorizontal;
  61. public Quaternion From;
  62. public Quaternion To;
  63. }
  64. }