18 lines
448 B
C#
18 lines
448 B
C#
using Unity.Netcode;
|
|
using UnityEngine;
|
|
|
|
public class PlayerAnimator : NetworkBehaviour {
|
|
private static readonly int isWalking = Animator.StringToHash("IsWalking");
|
|
[SerializeField] private Player player;
|
|
|
|
private Animator animator;
|
|
|
|
private void Awake() {
|
|
animator = GetComponent<Animator>();
|
|
}
|
|
|
|
private void Update() {
|
|
if (!IsOwner) return;
|
|
animator.SetBool(isWalking, player.IsWalking());
|
|
}
|
|
} |