Добавление задержки для прыжков + секретный переход на юнити 6.3
This commit is contained in:
1 parent
6732aef384
commit
f6e8131d22
14 files changed
+532
-860
No files matched your search
+23
-1
@@ -39,6 +39,11 @@ namespace Code.Gameplay.Character.Controller
|
||||
private Vector3 _currentFollowPointLocalPosition;
|
||||
private bool _wasSlidingLastFrame;
|
||||
|
||||
private float _jumpCooldownTimer;
|
||||
private float _jumpCooldownDuration => _characterConfig.jumpCooldown;
|
||||
|
||||
public bool CanJump => !isAbilitiesBlocked && _jumpCooldownTimer <= 0f;
|
||||
|
||||
// Подсистемы
|
||||
private CharacterInputHandler _inputHandler;
|
||||
private DashMechanic _dashMechanic;
|
||||
@@ -158,7 +163,16 @@ namespace Code.Gameplay.Character.Controller
|
||||
_inputHandler.ProcessInputs(ref inputs, motor);
|
||||
|
||||
// Передаём запрос прыжка
|
||||
_groundMovement.RequestJump(inputs.JumpPressed);
|
||||
var jumpInput = inputs.JumpPressed;
|
||||
|
||||
if (jumpInput && CanJump)
|
||||
{
|
||||
_groundMovement.RequestJump(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_groundMovement.RequestJump(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateRotation(ref Quaternion currentRotation, float deltaTime)
|
||||
@@ -363,6 +377,11 @@ namespace Code.Gameplay.Character.Controller
|
||||
_currentColliderCenter = _capsuleCollider ? _capsuleCollider.center : _originalColliderCenter;
|
||||
_currentFollowPointLocalPosition = _cameraFollowPoint ? _cameraFollowPoint.localPosition : _originalFollowPointLocalPosition;
|
||||
}
|
||||
|
||||
public void TriggerJump()
|
||||
{
|
||||
_jumpCooldownTimer = _jumpCooldownDuration;
|
||||
}
|
||||
|
||||
public void BeforeCharacterUpdate(float deltaTime)
|
||||
{
|
||||
@@ -380,6 +399,9 @@ namespace Code.Gameplay.Character.Controller
|
||||
{
|
||||
UpdateSlideTransition(deltaTime);
|
||||
|
||||
_jumpCooldownTimer -= deltaTime;
|
||||
if (_jumpCooldownTimer < 0f) _jumpCooldownTimer = 0f;
|
||||
|
||||
_wallLeanMechanic.Update(
|
||||
_wallRunningMechanic.IsWallRunning,
|
||||
_wallRunningMechanic.GetWallNormal(),
|
||||
|
||||
Reference in new issue
Block a user