Hello,
After some tests, SkeletonAnimator updates cost approximativly 50% more than SkeletonAnimation ones. (CPU)
So I just tried to use SkeletonAnimation, with an animator on the same gameobject, then add a StateMachineBehaviour like this one :
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
[...]
animator.GetNextAnimatorClipInfo(layerIndex, nextClip);
if(nextClip.Count > 0)
{
// Clip names are cached in animationHandle during GetClipName so there is no allocation each time it's called
animationHandle.SetAnimation(animationHandle.GetClipName(nextClip[0]), stateInfo.loop, layerIndex);
}
}
... And it works. So what is the point of SkeletonAnimtor ? Am I missing something?
I also checked the exemples (like "StateMachine SkeletonAnimation") and all state data is stored a second time (which could be really long to setup for a large count of anims) in a custom script, linking AnimationReference assets. Why not using the data in animator statemachine?
To sum up, why using SkeletonAnimator over SkeletonAnimation + a script?