PlayerAnimator.cs 435 B

123456789101112131415161718192021
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class PlayerAnimator : MonoBehaviour
  5. {
  6. private const string IS_WALKING = "IsWalking";
  7. [SerializeField] private Player player;
  8. private Animator animator;
  9. private void Awake()
  10. {
  11. animator = GetComponent<Animator>();
  12. }
  13. private void Update()
  14. {
  15. animator.SetBool(IS_WALKING, player.IsWalking());
  16. }
  17. }