Untitled

 avatar
unknown
csharp
6 months ago
486 B
14
Indexable
using UnityEngine;
using UnityEngine.InputSystem;

namespace TileVania
{
    public class PlayerAnimationManager : MonoBehaviour
    {
        [SerializeField] protected Animator _animator;

        protected virtual void OnMove(InputValue val)
        {
            Vector2 moveInput = val.Get<Vector2>();

            bool movingHorizontally = Mathf.Abs(moveInput.x) > float.Epsilon;
            _animator.SetBool("isRunning", movingHorizontally);
        }

    }
}
Editor is loading...
Leave a Comment