I'm trying to pause the animation of a SkeletonAnimation object at a particular frame. What I did first was to set the animation using the following code:
this.spineAnim.state.SetAnimation(0, animName, loop).TimeScale = speed;
After this I pause the animation by setting the TimeScale property of the SkeletonAnimation to 0. And then I set the time of the track entry using the following code.
Spine.TrackEntry trackEntry = this.spineAnim.state.GetCurrent(0);
// QQQ
Debug.LogWarning(this.itemCode + " Seek Time: " + seekTime.ToString());
Debug.LogWarning("Before - " + trackEntry.Animation.Name + " Duration: " + trackEntry.Animation.Duration.ToString() + " Time: " + trackEntry.AnimationTime);
trackEntry.TrackTime = seekTime;
// QQQ
Debug.LogWarning("After - " + trackEntry.Animation.Name + " Duration: " + trackEntry.Animation.Duration.ToString() + " Time: " + trackEntry.AnimationTime);
However, the pose of the spine animation did not change. When I traced the spine animation I get this:
arm4 Seek Time: 2
Before - idle Duration: 2 Time: 0
After - idle Duration: 2 Time: 0
Any suggestions on how to fix this? Thank you very much.