28 lines
555 B
C#
28 lines
555 B
C#
using Sirenix.OdinInspector;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[RequireComponent(typeof(Animator))]
|
|
public class AnimatorComponent : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
[ReadOnly]
|
|
private Animator animator;
|
|
|
|
[SerializeField]
|
|
[ReadOnly]
|
|
private float velocity;
|
|
|
|
private void Awake()
|
|
{
|
|
animator = GetComponent<Animator>();
|
|
}
|
|
|
|
public void UpdateVelocity(float velocity)
|
|
{
|
|
this.velocity = velocity;
|
|
animator.SetFloat("Velocity", velocity);
|
|
}
|
|
}
|