- Изменено
Hi,
I've created my Player prefab (using Unity + Adventure Creator) with Spine animation and I'm trying to ensure that certain animations do not get mixed with others. To achieve this, I came up with a script that plays specific animations on a higher track index.
Here's the script I'm using:
public void PlayBackOpeningLockerAnimation()
{
var currentAnimation = skeletonAnimation.AnimationState.GetCurrent(SpecialTrack);
if (currentAnimation == null)
{
skeletonAnimation.AnimationState.SetEmptyAnimation(SpecialTrack, 0.2f);
skeletonAnimation.AnimationState.AddAnimation(SpecialTrack, backOpeningLockerAnimation, false, 0);
}
else
{
skeletonAnimation.AnimationState.SetAnimation(SpecialTrack, backOpeningLockerAnimation, false);
}
// Optionally add an empty animation after back-opening-locker animation to avoid freeze frame
skeletonAnimation.AnimationState.AddEmptyAnimation(SpecialTrack, 0.2f, 0f);
}
However, this script still mixes the animation on the special track with the idle animation.
Did I miss anything here? Thank you for your help.