AnnulusGames/LitMotion

[Feature] Pause/Resume motions

AnnulusGames opened this issue · 3 comments

Add Pause() and Resume() extension methods to MotionHandle. This makes it possible to perform actions such as stopping a motion midway through playback.

Also add a method like IsPaused() or GetStatus() to check if it is paused.

Currently, the elapsed time of a motion is calculated by the difference from the start time. In order to implement the pause functionality, I need to change this back to adding deltaTime, but this may result in less accurate elapsed time calculations.

There also remains the question of whether this feature is necessary at all.
In my opinion, LitMotion should not have excessive functionality. This should not be added if pausing can be replaced by existing functionality.

Added MotionHandle.PlaybackSpeed property in #82. Pause can be achieved by assigning 0 to this.

The implementation has been changed to add double type deltaTime. Although the accuracy will be slightly lower, there is no practical problem.