var anim = GetComponent<SkeletonAnimation>();
anim.state.End += trackEntry => {
if (trackEntry.TrackIndex == 1)
{
// do something...
}
};
anim.state.SetAnimation(0, "Idle", true);
anim.state.SetAnimation(1, "Attack", false);
anim.state.AddEmptyAnimation(1, 0.0f, 0.0f);
After we adjusted the code as the method above, the animation works.
Play Idle
However, "AddEmptyAnimation()" will sent "End event" when the animation is done playing
Which leads to the "do something..." logic to execute again.
Will this problem be fixed, or it will be adjusted to add into "AddEmptyAnimation()" ?