Hello,
Is there any documentation on the AnimationState onEnd and onComplete? From my understanding onComplete is called at the end of each loop while onEnd is called at the end of the last loop, correct?
I've been having an issue when I try to set a new Animation in myonEnd callbacks. It usually results in some type of stack overflow where it continues to call my onEnd. I'm hoping someone might help me understand why this happens when I set a new animation in onEnd, but it doesn't happen when I use onComplete.
Here's a rough example of what's going on in my code:
Step 1:
setAnimationByName(0, "anim1", true)
state.onComplete = anim1OnComplete;
---
which performs Step 2 once loopCount > k
state.onEnd = nil;
Step 2:
setAnimationByName(0, "anim2");
state.onComplete = nil;
state.onEnd = anim2OnEnd;
---
which performs Step1
This is where it the stack overflow starts, it continues to attempt to play "anim1" and call "anim2OnEnd" over and over
Any idea why this happens? Like I mentioned before, the problem is easily fixed if I only use onComplete, which I rarely have issues with, but I'd still like to clarify my understanding of onEnd.
Thank you!