void Start() { currentAnimation = SaraAnimation.idle_sara; spineAnimation = GetComponent <SkeletonAnimation>(); spineAnimation.AnimationName = currentAnimation.ToString(); spineAnimation.AnimationState.End += OnAnimationEnded; }
void SetAnimation(SaraAnimation anim, bool loop) { if (currentAnimation != anim || spineAnimation.loop != loop) { currentAnimation = anim; spineAnimation.loop = loop; spineAnimation.AnimationName = currentAnimation.ToString(); } }