using System;
using UnityEngine;

namespace VOID.Generic.Objects.Unit.Animations
{
    [RequireComponent(typeof(Animator))]
    public class UnitAnimatorCallbacks : MonoBehaviour
    {
        public event Action<AnimationEvent> OnAnimationEvent;
        public event Action OnApplyRootMotion;

        private void OnStart(AnimationEvent animationEvent) => OnAnimationEvent?.Invoke(animationEvent);
        private void OnLoopStart(AnimationEvent animationEvent) => OnAnimationEvent?.Invoke(animationEvent);
        private void OnPerform(AnimationEvent animationEvent) => OnAnimationEvent?.Invoke(animationEvent);
        private void OnLoopEnd(AnimationEvent animationEvent) => OnAnimationEvent?.Invoke(animationEvent);
        private void OnEnd(AnimationEvent animationEvent) => OnAnimationEvent?.Invoke(animationEvent);

        private void FootL() {}
        private void FootR() {}

        private void OnAnimatorMove() => OnApplyRootMotion?.Invoke();
    }
}