Hi, I'm a bit confused here. I have the following events to keep track of animations:
private void Start() {
...some stuff before
animationState.Start += OnAnimationStart;
animationState.Complete += OnAnimationComplete;
animationState.Interrupt += OnAnimationInterrupt;
}
private void OnAnimationStart(Spine.TrackEntry trackEntry) {
if (trackEntry.Animation.Name == "attack-1") {
Debug.Log("attack anim started");
}
}
private void OnAnimationComplete(Spine.TrackEntry trackEntry) {
if (trackEntry.Animation.Name == "attack-1") {
Debug.Log("attack anim completed");
}
}
private void OnAnimationInterrupt(Spine.TrackEntry trackEntry) {
if (trackEntry.Animation.Name == "attack-1") {
Debug.Log("attack anim interrupted");
}
}
The code triggering the "attack-1" is just
animationState.SetAnimation(0, "attack-1", false);
No loop is involved.
The debug result is the following (code here and attached)
attack anim started
attack anim completed
attack anim completed
attack anim interrupted
why is complete
running twice?