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