16 lines
361 B
C#
16 lines
361 B
C#
using UnityEngine;
|
|
|
|
public class PlayerAnimator : MonoBehaviour {
|
|
private static readonly int isWalking = Animator.StringToHash("IsWalking");
|
|
[SerializeField] private Player player;
|
|
|
|
private Animator animator;
|
|
|
|
private void Awake() {
|
|
animator = GetComponent<Animator>();
|
|
}
|
|
|
|
private void Update() {
|
|
animator.SetBool(isWalking, player.IsWalking());
|
|
}
|
|
} |