Sorry, remind me what runtime you use again? :p
I'm wondering if you can use Animation::Apply for your purpose.
Ah, TK2D.
Hello, Spine-C# friend. XD
What you might want to do is keep a reference to the Spine.Animation
you want. Let's say you store it as mySpineAnimation
. And that you also store a reference to the Spine.Skeleton
as mySkeleton
Then say:
mySpineAnimation.Apply(mySkeleton, 0, durationOfTheAnimation, false, null);
What this does is pose the skeleton at the time of durationOfTheAnimation
. You can probably get durationOfTheAnimation from mySpineAnimation.duration
.
The null
at the end makes it ignore events.
The other option is to just say:
(skeletonAnimtion.state.SetAnimation(0, mySpineAnimation, false)).time = durationOfTheAnimation;
I'm not sure about that second one though. It might just cause the animation to not be applied at all. But that's how you would play an animation starting from a certain point in time. SetAnimation returns a TrackEntry
object you can modify immediately after setting an animation. For more info on what info TrackEntry has, check the code of AnimationState.cs