Thanks. That's the documentation I worked my way through today to get the details.
Nate yazdı:Oh no, please don't look at AnimationState!

If you find any bugs, they tend to be difficult to reproduce and fix!

Oh no! Well, let's hope for the best
Nate yazdı:The
complete event doesn't mean a track entry is finished, it means it completed one loop. If the track entry is looping and you let the animation play, you'll see the complete event again and again.
I took the same from the documentation and see it happening in the demo project I've created where I created a visual timeline and indicators that pop up to show the events being fired. Thanks for confirming.
Nate yazdı:In your scenario the animation A was indeed interrupted, meaning another entry (animation B) has replaced it as the current entry for the track. When any mix duration is finished, you'll see for animation A an end
event (because it will not be applied anymore) and then a dispose
event (because everything is done with the track entry object and it may be reused or the memory freed).
Nate yazdı:You mentioned addAnimation
and setAnimation
, but the interrupt
event should happen for both -- any time the entry is no longer the current entry. If you've reached the animation duration (and you have if you've seen a complete
event) then addAnimation
and setAnimation
should be equivalent (should be, they are slightly different code paths).
Thanks. I understood the
end
and
dispose
events. But if I get you right I didn't quite understood the
interrupt
event? You're saying the
interrupt
event ALWAYS fires when whatever other animation replaces the current animation on the same track? Even if the animation was already completed (and loop was set to
false
)?
Nate yazdı:Here's an interesting tidbit: TrackEntry events are collected during AnimationState
update
and AnimationState
apply
and fired only after those methods are finished. I'll add this note to the documentation. It means that if you make changes in an
AnimationStateListener
, the collected events are still fired, even if your listener makes changes, like clearing a track. This can be a surprise -- you can set an animation or clear a track (from listener code) and afterward you may still get some events for the old track entry that is no longer the current entry for the track. If you come across this, you can check if the track entry for the event is the current entry for the track. In some cases it doesn't matter (eg to turn off particle effects) but in others it might (eg if you are setting the next animation in a sequence, you probably only want to do that when the event is for the current entry).
The events are collected and fired later as described because if we fired them in the middle of
update
or
apply
and your listener code called other AnimationState methods, it could change the internal AnimationState state, make for difficult to solve problems.
Not sure if that's what I'm bumping into. looks like you're describing something else here and only talk about events that happen pretty much at the same time.
I think I'm having a different issue here. The issue in the other project, that I'm trying to figure out now what is happening exactly. The situation I'm having now in that project is (all on the same animation track):
1) Animation
A (non-looping animation) starts
2) Before completed Animation
A gets swapped by Animation
B with a mix transition of around 0,5 sec
3) The animation state object receives a
complete
event from Animation
A (which should never occur (as the
eventThreshold
is never set throughout the whole project, so should still be zero, meaning no events of Animation
A should be fired once Animation
B got started - which btw works as expected in pixi-spine in the demo-project I've created now)
This is causing a problem in the project, because:
4) The complete handler now thinks Animation
A was fully completed (which in fact is not the case, because interrupted by Animation
B) and triggers animation
C (which is an IDLE animation that should only play once animation
A was finished)
So now Animation
B is suddenly interrupted while playing, or didn't even got the time to play. Which obviously is a problem as not intended.
I don't understand why animation
A still is able to trigger the
complete
event while already replaced by animation
B (
setAnimation()
is definitely called to start animation
B. I see that happening). Especially because the
eventThreshold
is zero. Any clue on what to do about this? Is this something I'm missing, perhaps the situation you're describing or could this be a bug somewhere? How to solve this unwanted behaviour?
spineappletree yazdı:max amount of chars in the title of threads
Nate yazdı:We didn't change this recently
Haha, ok. I've never noticed that before either and couldn't type more characters anymore, which was confusing. That's why I thought it was changed. 60 Chars is pretty stone age though. Even DOS had 80 chars on screen when we were still cave men

Minor details though of course.