Finish my animations
This commit is contained in:
parent
7c0c6eda6a
commit
0859e4b36c
12 changed files with 156 additions and 23 deletions
23
Assets/Scripts/PlayerAnimator.cs
Normal file
23
Assets/Scripts/PlayerAnimator.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerAnimator : MonoBehaviour
|
||||
{
|
||||
|
||||
private const string IS_WALKING = "IsWalking";
|
||||
|
||||
[SerializeField] private Player player;
|
||||
private Animator animator;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
animator.SetBool(IS_WALKING, player.IsWalking());
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue