Finally bots can die. Player to. And another fixes.
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
using Unity.Mathematics;
|
||||
using System;
|
||||
using CameraScripts;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Animators.Leonid_Animator
|
||||
@ -10,7 +12,7 @@ namespace Animators.Leonid_Animator
|
||||
|
||||
private int _horizontal;
|
||||
private int _vertical;
|
||||
private bool _isCrouching = false;
|
||||
public bool isCrouching = false;
|
||||
private bool _isJumping;
|
||||
|
||||
private int _crouch;
|
||||
@ -77,14 +79,8 @@ namespace Animators.Leonid_Animator
|
||||
|
||||
if (pressedCrouching == true)
|
||||
{
|
||||
_isCrouching = !_isCrouching;
|
||||
if (_isCrouching == true)
|
||||
transform.Rotate(Vector3.up, 45);
|
||||
else
|
||||
{
|
||||
transform.Rotate(Vector3.up, -45);
|
||||
}
|
||||
anim.SetBool(_crouch, _isCrouching);
|
||||
isCrouching = !isCrouching;
|
||||
anim.SetBool(_crouch, isCrouching);
|
||||
}
|
||||
|
||||
anim.SetBool(_jump, pressedJumped);
|
||||
|
@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Animators.Leonid_Animator.Player
|
||||
{
|
||||
@ -19,15 +20,19 @@ namespace Animators.Leonid_Animator.Player
|
||||
[SerializeField] public float jumpForce;
|
||||
|
||||
[Header("Stats")]
|
||||
[SerializeField] private float movementSpeed = 5;
|
||||
[SerializeField] private float movementSpeed = 25;
|
||||
[SerializeField] private float rotationSpeed = 10;
|
||||
|
||||
private void Start()
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
myRigidbody = GetComponent<Rigidbody>();
|
||||
_inputHandler = GetComponent<InputHandler>();
|
||||
myAnimatorHandler = GetComponent<AnimatorHandler>();
|
||||
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_cameraObject = Camera.main.transform;
|
||||
myTransform = transform;
|
||||
myAnimatorHandler.Initialize();
|
||||
@ -70,6 +75,16 @@ namespace Animators.Leonid_Animator.Player
|
||||
_inputHandler.crouchPressed = false;
|
||||
}
|
||||
|
||||
public Vector3 GetMeshCenter()
|
||||
{
|
||||
if (myAnimatorHandler.isCrouching)
|
||||
return transform.position + 1f * Vector3.up;
|
||||
else
|
||||
{
|
||||
return transform.position + 2f * Vector3.up;
|
||||
}
|
||||
}
|
||||
|
||||
#region Movement
|
||||
|
||||
private Vector3 _normalVector;
|
||||
|
@ -1,4 +1,5 @@
|
||||
using CameraScripts;
|
||||
using System;
|
||||
using CameraScripts;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Animators.Leonid_Animator.Player
|
||||
@ -21,7 +22,7 @@ namespace Animators.Leonid_Animator.Player
|
||||
|
||||
private CameraHandler _cameraHandler;
|
||||
|
||||
private void Awake()
|
||||
private void Start()
|
||||
{
|
||||
_cameraHandler = CameraHandler.Singleton;
|
||||
if (_cameraHandler == null)
|
||||
|
Reference in New Issue
Block a user