I've imported a couple of Spine animations into Unity and successfully set it up. When the scene plays, the character automatically plays a looping idle animation. Then there's a button, which triggers a dance animation instead. Like this:
public void getDance()
skeletonAnimation.state.SetAnimation(0, "Dance", true);
The dance animation is only 150 or so frames long, then I need it to return to the idle animation. However, the way it's set up, it doesn't return and keeps looping the dance.
I tried to research ways I could use spine animations like you would with the "Animator" view with sprite animations. However, I can't seem to find anything. Is it possible to do this? Or does it work completely differently now? How could I program the idle animation to come back after playing the dance once? I've watched all the official Unity tutorials on using the Animator, I'm just confused how to apply it to Spine animations, instead of sprites.
I'm quite new to game development, so the more detailed you can get, the better. Or if there is a tutorial out there I'm just not finding, post it here. Thank you very much for your help! 🙂
17 Sep 2015, 16:03
Okay, so I figured out how to run spine animations in the Animator. (Called mecanim?)
And I researched more and figured out theres a way to set events during the animation, somewhere in the inspector. Can't seem to find this.