I'll try to provide full info.
As I mentioned before, I have an animation sequence. The full needed algorithm is described in the first post. Additional info - I have to count animations (for example, I have to repeat animation B for N times, then begin new transition), that's why I am using SetAnimation, not AddAnimation.
I am playing animation like:
_animation.AnimationState.SetAnimation(0, animationName, true);
_animation is SkeletonGraphic.
If animation is looped and I need to count the number of repetitions, I use this code to subscribe to animation complete event:
_animation.AnimationState.Complete += OnAnimationComplete;
In OnAnimationComplete callback I check current animation requested repeat count left and if it reaches zero, unsubscribe from animation complete event:
_animation.AnimationState.Complete -= OnAnimationComplete;
If there is next animation defined in sequence, the procedure is repeated with next animation.
So, for "transition from animation A to animation B using animation AtoB" algorithm is:
- Wait for complete animation A
- Start animation AtoB and subscribe complete event
- In the OnAnimationComplete callback unsubscribe complete event and start animation B
- If I need to repeat animation B for the defined number of times, subscribe to animation complete event
etc.
The bug is visual and looks like the first frame of AtoB animation at the moment when animation B should begin. And, as I said before, the most confusing is the fact, that from time to time, the animation sequence looks great, as it should be.
This is settings of skeleton, used for animations to prevent questions about mix durations: