Hi.
Could you help me with this component? I set it up but it doesn't work at all. What am I doing wrong?
As I understand it, it should run the function I put into the field once Spine event "handle" appears.
Also I tried to subscribe to event from code and failed too
Here is my code, I get it from documentation:
private void Start()
{
eventSkeleton.AnimationState.Event += HandleEvent;
eventSkeleton.AnimationState.Start += delegate (Spine.TrackEntry trackEntry) {
// You can also use an anonymous delegate.
Debug.Log(string.Format("track {0} started a new animation.", trackEntry.TrackIndex));
};
eventSkeleton.AnimationState.End += delegate {
// ... or choose to ignore its parameters.
Debug.Log("An animation ended!");
};
}
private void HandleEvent(Spine.TrackEntry trackEntry, Spine.Event e)
{
Debug.Log("HandleEvent "+e.Data.Name);
// Play some sound if the event named "footstep" fired.
}
Here I'm never getting message in the log from HandleEvent
Please help. Any way from these too will work for me.
I use runtime 4.0 and Spine 4.0.58
Unity 2020.3.20f1