public void PlayFiniteAnimation(AnimationClip clip)
 {
     if (clip != null)
     {
         CurrentAnimationState.Stop();
         var state = animancer.Play(clip);
         state.Events.OnEnd += delegate { state.IsPlaying = false; };
     }
 }
 public void PlayFiniteAnimationWithAction(AnimationClip clip, Action OnEndAction)
 {
     if (clip != null)
     {
         CurrentAnimationState?.Stop();
         var state = animancer.Play(clip);
         state.Events.OnEnd += delegate { state.IsPlaying = false; };
         state.Events.OnEnd += OnEndAction;
         //state.Events.OnEnd += delegate {gameObject.SetActive(false);};
         state.Events.OnEnd += delegate { state.Events.OnEnd = null; };
     }
 }