Almost Final Version
This commit is contained in:
8
Assets/Scripts/Animators/Leonid Animator/Bot.meta
generated
Normal file
8
Assets/Scripts/Animators/Leonid Animator/Bot.meta
generated
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 09d06d136b63f664ca69050e45726199
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/Scripts/Animators/Leonid Animator/Bot/BotLocomotion.cs.meta
generated
Normal file
3
Assets/Scripts/Animators/Leonid Animator/Bot/BotLocomotion.cs.meta
generated
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ad80a2bc9a9477f93ab26af02a07582
|
||||
timeCreated: 1652616279
|
8
Assets/Scripts/Animators/Leonid Animator/Player.meta
generated
Normal file
8
Assets/Scripts/Animators/Leonid Animator/Player.meta
generated
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f4aef398dbeb02429a5834250b01855
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Animators.Leonid_Animator
|
||||
namespace Animators.Leonid_Animator.Player
|
||||
{
|
||||
[RequireComponent(
|
||||
typeof(Rigidbody),
|
||||
@ -17,13 +17,11 @@ namespace Animators.Leonid_Animator
|
||||
|
||||
public Rigidbody myRigidbody;
|
||||
[SerializeField] public float jumpForce;
|
||||
public GameObject normalCamera;
|
||||
|
||||
[Header("Stats")]
|
||||
[SerializeField] private float movementSpeed = 5;
|
||||
[SerializeField] private float rotationSpeed = 10;
|
||||
|
||||
public float health = 100f;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
myRigidbody = GetComponent<Rigidbody>();
|
||||
@ -37,12 +35,6 @@ namespace Animators.Leonid_Animator
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
||||
if (Input.GetButtonDown("Fire1") && health > 0)
|
||||
{
|
||||
health -= 5;
|
||||
}
|
||||
|
||||
var deltaTime = Time.deltaTime;
|
||||
_inputHandler.TickInput(deltaTime);
|
||||
_moveDirection = _cameraObject.forward * _inputHandler.vertical
|
@ -1,7 +1,7 @@
|
||||
using CameraScripts;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Animators.Leonid_Animator
|
||||
namespace Animators.Leonid_Animator.Player
|
||||
{
|
||||
public class InputHandler : MonoBehaviour
|
||||
{
|
Reference in New Issue
Block a user