Hi,
I'm a developer and new to Spine. I'm working on a Unity 2dtoolkit project that is using some Spine generated assets and I'm having trouble triggering the default events, like start, complete and end.
For example, I need to know when a certain completes and I'm using this code:
void Start ()
{
skeletonAnimation = GetComponent<SkeletonAnimation>();
skeletonAnimation.state.SetAnimation(0, "idle", true);
skeletonAnimation.state.Complete += AnimationCompletedEventHandler;
skeletonAnimation.state.End += AnimationEndedEventHandler;
jumpQueued = false;
}
void AnimationCompletedEventHandler(Spine.AnimationState state, int trackIndex, int loopCount)
{
Debug.Log("animation completed: " + state.GetCurrent(trackIndex).Animation.Name);
}
The animation is working, it keeps looping forever but no sign of the completed event being triggered.
Am I doing something wrong? Do I need to tell the artists to turn on some flag on the spine project? I don't have access to the spine software, just the models.
It would be very nice if you have a very simplified version only for developers, where we could configure the events and export the models. Paying the pro price just for that is a little overkill. Turn off all the editing features, it should help a lot people that, like me, both work separately from artists and whose artists don't know nothing about exporting and events details.
Best regards,