Almost Final Version
This commit is contained in:
@ -0,0 +1,38 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Animators.Leonid_Animator.Bot
|
||||
{
|
||||
[RequireComponent(typeof(Rigidbody))]
|
||||
[RequireComponent(typeof(AnimatorHandler))]
|
||||
[RequireComponent(typeof(MovementController))]
|
||||
[RequireComponent(typeof(NPC))]
|
||||
public class BotLocomotion : MonoBehaviour
|
||||
{
|
||||
private Vector3 _moveDirection;
|
||||
private Transform _myTransform;
|
||||
|
||||
private AnimatorHandler _myAnimatorHandler;
|
||||
private MovementController _movementController;
|
||||
private NPC _npc;
|
||||
private Rigidbody _myRigidbody;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_myRigidbody = GetComponent<Rigidbody>();
|
||||
_myAnimatorHandler = GetComponent<AnimatorHandler>();
|
||||
_movementController = GetComponent<MovementController>();
|
||||
_npc = GetComponent<NPC>();
|
||||
|
||||
_myTransform = transform;
|
||||
_myAnimatorHandler.Initialize();
|
||||
}
|
||||
|
||||
public void UpdateAnimatorValues()
|
||||
{
|
||||
var movementDir = _movementController.Velocity;
|
||||
|
||||
_myAnimatorHandler.UpdateAnimatorValues(movementDir.y, movementDir.x,
|
||||
false, _npc.NpcBodyState is NpcCrouchingState, _npc.IsFiring);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user