Hey there,
I have the problem calling SetAnimation on two different Skeleton Animation states, resulting in only one being changed.
I have a sheep head and a sheep body, the head following the body with the Bone Follower script.
With this code, the error occurs:
public void ChangeSheep(SkeletonAnimation body, SkeletonAnimation head){
SetAnimation (AnimationType.Exit);
Spine.AnimationState.StartEndDelegate test = null;
test = (Spine.AnimationState state, int trackIndex) => {
if (!AnimationIs(state, AnimationType.Exit))
return;
currentBodyState.End -= test;
body.state.SetAnimation (0, enter[0], false);
head.state.SetAnimation (0, enter[0], false);
};
currentBodyState.End += test;
}
AnimationIs just checks if the Animation that's ending is the Exit animation set at the top of the body. SetAnimation from the lambda is then working for the head, but not for the body and I don't understand why it's not working, it's dealing with head and body the same, except the un-/ subscription of the event.