using Spine;
using Spine.Unity;

namespace BingoBrain.Core
{
    public static class NAAVsa
    {
        private const int CurrTrack = 0;


        public static TrackEntry PlayAnim(SkeletonAnimation animCom, string animName, bool isLoop)
        {
            return animCom.AnimationState.SetAnimation(CurrTrack, animName, isLoop);
        }

        public static TrackEntry PlayAnim(SkeletonAnimation animCom, string animName)
        {
            return animCom.AnimationState.SetAnimation(CurrTrack, animName, false);
        }

        public static void AddCompleteEvent(SkeletonAnimation animCom, Spine.AnimationState.TrackEntryDelegate func)
        {
            animCom.AnimationState.Complete += func;
        }

        public static void SetSkin(SkeletonAnimation animCom, string skinName)
        {
            animCom.Skeleton.SetSkin(skinName);
        }
    }
}