If you do not understand the problem I have encountered based on the title, let me explain.
I've set up a script that looks for Spine events in animations. Contained in this is below.
private void OnAnimationEvent (Spine.TrackEntry entry, Spine.Event e)
{
//Handle animation events in here
if (e.Data.Name == footstepEvent)
{
print("Footstep event");
}
print (e.Data.Name);
if (e.Data.Name == "swing")
{
print("Swing event");
}
}
This code works perfectly fine if I use
SetAnimation...
or
AddAnimation...
on track index 0 like so.
skeletonAnimation.AnimationState.AddAnimation (0, attackAnimation, false, 0f);
However, this is not how I am setting my animations up. I have the base track index which is responsible for walk, run etc, and track index 1 is used for attack, block etc. The walk/run animations have a "footstep" event, and the attack animation has a "swing" event. The footstep event is to add footstep sounds, and the swing event is to add a swoosh sound for the weapon.
The problem I am facing is receiving events from track index 1 while also receiving events from track index 0. Currently, while the walk animation is playing (track index 0) and I play the attack animation (track index 1), only the footstep event is firing.
I'm assuming this is a bug and not how the runtime was designed? Does anyone have a solution?