I have a callback listening to events. I have verified that each event only appears once.
However each event is fired twice (at the same time). I only call 1 animation and on one spine object and there is only one reference (so there arent two units firing events, or two listeners to one event).
The code is relatively simple:
// Event Listener
_skeletonAnimation.AnimationState.Event += (TrackEntry, Event) =>
{
if (animationEventCallback != null)
{
animationEventCallback(Event.Data.Name, unitState); // Called twice for every event
}
};
// The animation invoke
animationEventCallback = (eventName, unit) => { Debug.Log(eventName) };
_animationState.SetAnimation(0, "animationWithOneEventThatsCalledTwice", loop);
Every single event is called twice at the same time even though it only appears once in the timeline in Spine2D.
I did a time printout with each event and I get a log like this
[Log] Time passed is 0.0204173 for grrblReaction
[Log] Time passed is 0.0204173 for grrblReaction
[Log] Time passed is 0.0204173 for monsterReaction
[Log] Time passed is 0.0204173 for monsterReaction
[Log] Time passed is 0.0755396 for moveGrrblForward
[Log] Time passed is 0.0755396 for moveGrrblForward
[Log] Time passed is 2.10146 for cameraShake
[Log] Time passed is 2.10146 for cameraShake
[Log] Time passed is 2.10146 for monsterKnockback
[Log] Time passed is 2.10146 for monsterKnockback
[Log] Time passed is 2.10146 for tweenMonsterRed
[Log] Time passed is 2.10146 for tweenMonsterRed
[Log] Time passed is 2.305758 for tweenMonsterWhite
[Log] Time passed is 2.305758 for tweenMonsterWhite
[Log] Time passed is 2.500231 for tweenMonsterNormal
[Log] Time passed is 2.500231 for tweenMonsterNormal
[Log] Time passed is 2.567319 for moveGrrblBack
[Log] Time passed is 2.567319 for moveGrrblBack
Can you think of a reason my events are firing twice with only one reference?
Here is a screen shot of the spine file with each event being dispatched once: