Implement enemy spawning and following waypoints
This commit is contained in:
27
Assets/Scripts/Components/AnimatorComponent.cs
Normal file
27
Assets/Scripts/Components/AnimatorComponent.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user