Final commit

This commit is contained in:
2022-05-18 00:21:35 +07:00
parent ebddcadc38
commit 4132787ef8
1671 changed files with 697308 additions and 714 deletions

View File

@ -9,29 +9,32 @@ namespace Animators.Leonid_Animator.Bot
public class BotLocomotion : MonoBehaviour
{
private Vector3 _moveDirection;
private Transform _myTransform;
private AnimatorHandler _myAnimatorHandler;
private MovementController _movementController;
private NPC _npc;
private Rigidbody _myRigidbody;
private NpcBodyState _crouchBuffer = NpcBodyState.Standing;
private void Start()
{
_myRigidbody = GetComponent<Rigidbody>();
_myAnimatorHandler = GetComponent<AnimatorHandler>();
_movementController = GetComponent<MovementController>();
_npc = GetComponent<NPC>();
_myTransform = transform;
_myAnimatorHandler.Initialize();
}
private bool CrouchPressed(NpcBodyState state)
{
if (_crouchBuffer == state) return false;
_crouchBuffer = state;
return true;
}
public void UpdateAnimatorValues()
{
var movementDir = _movementController.Velocity;
_myAnimatorHandler.UpdateAnimatorValues( Mathf.Clamp01(movementDir.magnitude), 0,
false, _npc.NpcBodyState is NpcCrouchingState, _npc.IsFiring);
false, CrouchPressed(_npc.NpcBodyState.State), _npc.IsFiring);
}
}
}