using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerAnimation : MonoBehaviour { private Animator anim; private Rigidbody2D rb; private PhysicsCheck physicsCheck; private void Awake() { anim = GetComponent(); rb = GetComponent(); physicsCheck = GetComponent(); } private void Update() { SetAnimation(); } private void SetAnimation() { anim.SetFloat("velocityX", Mathf.Abs(rb.velocity.x)); anim.SetFloat("velocityY", rb.velocity.y); anim.SetBool("isGround", physicsCheck.isGround); } }