Hey Guys, this blog is part of a series " Skeleton animation in Unity". In this i'll try to explain "how to play animations of spine objects in Unity".
For this make sure you have "spine-unity.unitypackage" plugin in your project.
It is assumed that you have already Instatntitated your spine object in Game Scene.
Step1: Create a script as "PlayerAnimations.cs" an apply it on Spine Character.
Step 2: Use following code :
We will play animations on Key press
using System.Collections;public class PlayAnimation : MonoBehaviour
//assign all spine animations of game character to string variables
SkeletonAnimationskeletonAnimation; //skeleton animation variable will used to call methods of SkeletonAnimation
//Function to set animations to spine character or we can set animation directly without making this function.
Now you can play animations on key press of spine object.