Hi everyone,
I'm seeing an odd issue with the 2D Toolkit on Unity. I have two animations (idle and death), and when I call SetAnimation to switch to the death animation the object just disappears from the game.
Has anyone experienced similar issues? It's worth mentioning that switching the animation in the inspector window takes effect only after I check or uncheck "calculate normals".
My code is simple and almost entirely copied from the spineboy example.
public class Hittable : MonoBehaviour {
private SkeletonAnimation skeleton;
// Use this for initialization
void Start () {
skeleton = GetComponent<SkeletonAnimation>();
skeleton.state.Event += Event;
}
public void Event (object sender, Spine.EventTriggeredArgs e) {
Debug.Log(e.TrackIndex + " " + skeleton.state.GetCurrent(e.TrackIndex) + ": event " + e.Event + ", " + e.Event.Int);
}
// Update is called once per frame
void Update () {
}
void OnCollisionEnter2D(Collision2D collision) {
skeleton.state.SetAnimation(0, "death", true);
}
}
Thanks!