This is true. Events aren't firing during crossfading/mixing.
Here's the culprit: https://github.com/EsotericSoftware/spi ... .java#L102
You can probably fix it yourself.
Here's what I changed in the C# code to make it work. See the code here: https://github.com/pharan/spine-runtime ... e028efa04e
Just two lines were changed in AnimationState.cs. You could likely make the same changes in AnimationState.java
. (Don't worry, C# and Java are very closely related. At the very least, method calls and member value assignments are the same so this should work.)
The three changes were:
1) Pass previous.lastTime
and previousTime
instead of previousTime, previousTime
as the lastTime
and time
parameters.
2) Pass the events array when you apply the previous animation instead of passing null.
3) Right after that line, update previous track's time using previous.lastTime = previousTime;
I think I can tell one situation why it was done this way, 'cause if you were crossfading from a walk to a run, you'd get two footstep events per footstep instead of one.
On the other hand, for unique events that are semantically in the first one but not in the second one, you'd really want those first-animation events to fire. So it really made no sense to me why Nate chose to implement it this way. I'm sure he had his reasons. Anyway, hope this fixes it for you. I can't really confirm the fix myself since I don't have a functioning libGDX setup but do give it a shot. I'm pretty confident that those two lines will make it work.