TrackEntry.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. using System;
  2. using System.Diagnostics;
  3. namespace Spine
  4. {
  5. public class TrackEntry
  6. {
  7. public Animation Animation
  8. {
  9. get
  10. {
  11. return this.animation;
  12. }
  13. }
  14. public float Delay
  15. {
  16. get
  17. {
  18. return this.delay;
  19. }
  20. set
  21. {
  22. this.delay = value;
  23. }
  24. }
  25. public float Time
  26. {
  27. get
  28. {
  29. return this.time;
  30. }
  31. set
  32. {
  33. this.time = value;
  34. }
  35. }
  36. public float LastTime
  37. {
  38. get
  39. {
  40. return this.lastTime;
  41. }
  42. set
  43. {
  44. this.lastTime = value;
  45. }
  46. }
  47. public float EndTime
  48. {
  49. get
  50. {
  51. return this.endTime;
  52. }
  53. set
  54. {
  55. this.endTime = value;
  56. }
  57. }
  58. public float TimeScale
  59. {
  60. get
  61. {
  62. return this.timeScale;
  63. }
  64. set
  65. {
  66. this.timeScale = value;
  67. }
  68. }
  69. public float Mix
  70. {
  71. get
  72. {
  73. return this.mix;
  74. }
  75. set
  76. {
  77. this.mix = value;
  78. }
  79. }
  80. public bool Loop
  81. {
  82. get
  83. {
  84. return this.loop;
  85. }
  86. set
  87. {
  88. this.loop = value;
  89. }
  90. }
  91. //[DebuggerBrowsable(DebuggerBrowsableState.Never)]
  92. public event AnimationState.StartEndDelegate Start;
  93. //[DebuggerBrowsable(DebuggerBrowsableState.Never)]
  94. public event AnimationState.StartEndDelegate End;
  95. //[DebuggerBrowsable(DebuggerBrowsableState.Never)]
  96. public event AnimationState.EventDelegate Event;
  97. //[DebuggerBrowsable(DebuggerBrowsableState.Never)]
  98. public event AnimationState.CompleteDelegate Complete;
  99. internal void OnStart(AnimationState state, int index)
  100. {
  101. if (this.Start != null)
  102. {
  103. this.Start(state, index);
  104. }
  105. }
  106. internal void OnEnd(AnimationState state, int index)
  107. {
  108. if (this.End != null)
  109. {
  110. this.End(state, index);
  111. }
  112. }
  113. internal void OnEvent(AnimationState state, int index, Event e)
  114. {
  115. if (this.Event != null)
  116. {
  117. this.Event(state, index, e);
  118. }
  119. }
  120. internal void OnComplete(AnimationState state, int index, int loopCount)
  121. {
  122. if (this.Complete != null)
  123. {
  124. this.Complete(state, index, loopCount);
  125. }
  126. }
  127. public override string ToString()
  128. {
  129. return (this.animation != null) ? this.animation.name : "<none>";
  130. }
  131. internal TrackEntry next;
  132. internal TrackEntry previous;
  133. internal Animation animation;
  134. internal bool loop;
  135. internal float delay;
  136. internal float time;
  137. internal float lastTime = -1f;
  138. internal float endTime;
  139. internal float timeScale = 1f;
  140. internal float mixTime;
  141. internal float mixDuration;
  142. internal float mix = 1f;
  143. }
  144. }