Can i max anims on different track via AnimationState? My scenario is so:
1) On 0-Track is IDLE animation for the body without hands (loop).
2) On 1-Track is always playing animation for idle with sword (loop).
3) Sometime on track 2 is playing not looping attack anim.
The problem is after attack animation (track 2) ends, animation_state just "jumps" to sword-idle-anim (track 1) without any mixing. How can i achieve smooth behavior for different tracks?
public class TestMe : MonoBehaviour {
SkeletonAnimation anim;
// Use this for initialization
void Start () {
anim = GetComponent<SkeletonAnimation>();
anim.state.SetAnimation (0, "IDLE", true);
anim.state.SetAnimation (1, "sword_idle_R", true);
}
// Update is called once per frame
void Update () {
if (Input.anyKeyDown) {
Test ();
}
}
void Test() {
anim.state.SetAnimation (2, "sword_high_R", false);
//anim.state.AddAnimation (2, "sword_idle_R", false, 0);
}
}
P.S. You might be wondering, why am i using 2 separate tracks for weapon_idle and weapon_hit. There are two reason why this is pretty comfortable.
1) It's very easy to determinate if player is attacking now. Just check something is playing on attack-track. No need to handle bool vars for this manually.
2) No need to transition states idle->attack and vice versa. sword idle is always played, but sometimes overriden by sword attack. The only problem is mixing here.