• Unity
  • Missing methods

Related Discussions
...

I'm trying to check for footstep events so I can play a sound with it. According to the AnimationState API, a method called addListener (AnimationState addListener) should be there. But I've checked AnimationState.cs and it's definitely not there, nor can I access it. Am I missing something? Is it done differently in Unity?

Sorry for the confusion. Some runtimes differ slightly from the API reference, depending on the particular game toolkit and programming language. The API reference is relatively new, someday we hope to provide programming language and game toolkit specific information in the API reference.

In this particular case, C# has its own event system which is used instead of an addListener method. There are other minor differences, such as some languages (like C#) have conventions which capitalize the first letter of methods and properties. For spine-c, function names look like spAnimationState_addListener.

You can checkout the examples to see how a listener is added in C#:
spine-runtimes/Raptor.cs at master