We already have our script for our character I'm just trying to figure our how to does Spine animation works because they looks far different from Unity3D animations.
I managed to make my character jump while he's walking and to detect an idle state but I I can't make it walk again after a jump.
void Update(){
if(Input.GetAxis("Horizontal") > 0.1f){
isRunning = true;
dir = 1;
}
if(Input.GetAxis("Horizontal") < -0.1f){
isRunning = true;
dir = -1;
}
if(Input.GetAxis("Horizontal") == 0.0f){
isRunning = false;
}
if(isRunning && anim != "walk" && anim != "jump"){
anim = "walk";
skeletonAnimation.state.SetAnimation(0, anim, true);
gameObject.transform.localScale = new Vector3(dir * 1.0f, 1.0f, 1.0f);
}
if(!isRunning && anim != "drawOrder"){
anim = "drawOrder";
skeletonAnimation.state.SetAnimation(0, anim, false);
}
if(Input.GetKeyUp(KeyCode.Space) && anim != "jump"){
anim = "jump";
skeletonAnimation.state.AddAnimation(0, anim, false, 0);
}
}