Our Unity guru, Harald, will be along tomorrow, but check this part of the docs (scroll down a little to where it says C#
):
spine-unity Runtime Documentation: Life cycle
The code snippet you found for Combining Skins omits this boilerplate:
public class YourComponent : MonoBehaviour {
SkeletonAnimation skeletonAnimation;
Skeleton skeleton;
void Awake () {
skeletonAnimation = GetComponent<SkeletonAnimation>();
skeleton = skeletonAnimation.Skeleton;
}
}
That's likely the part you are missing: you need to add two fields to your class and set them in Awake()
, then you can use them in your other methods.
The GetComponent
call is Unity API to get a component on the Unity GameObject, so you'll need to be sure you have a SkeletonAnimation
on the GameObject you have attached your behavior (script) to.
Hopefully I did not butcher the (weird) Unity terminology. 🙂