[By Design] cyclesDone property never reaches the total number of cycles #116
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hey, thank you for creating this topic! Casting float to int has the same behavior as Mathf.FloorToInt() for positive numbers and the current implementation is the intended one. You can only observe the You can think of the cyclesDone the following way: it equals to |
Beta Was this translation helpful? Give feedback.
-
I reopened the discussion so it can be found easier. |
Beta Was this translation helpful? Give feedback.
Hey, thank you for creating this topic!
Casting float to int has the same behavior as Mathf.FloorToInt() for positive numbers and the current implementation is the intended one.
You can only observe the
cyclesDone == settings.cycles
if you pause the animation and set thetween.progressTotal = 1f
manually. But under normal circumstances animation completes immediately when it reaches the last cycleDone, so it would not be possible to observe that in the Inspector.You can think of the cyclesDone the following way: it equals to
0
on the first cycle (no cycles completed yet) and equals tocycles - 1
on the last cycle. And the exact moment the last cycle completes, the animation is recycled i…