прорвёмся (добавлен walljump)

This commit is contained in:
MrTorex committed 2025-11-27 21:36:19 +03:00
1 parent 01d3b0adec
commit d10d2cdca6
2 files changed
+51 -7

No files matched your search

@@ -30,7 +30,7 @@ namespace Code.Gameplay.Character.Controller
private SlideMechanic _slideMechanic;
// private WallClimbMechanic _wallClimbMechanic;
private WallRunningMechanic _wallRunningMechanic;
private WallLeanMechanic _wallLeanMechanic;
//private WallLeanMechanic _wallLeanMechanic;
private GroundMovementSystem _groundMovement;
private AirMovementSystem _airMovement;
@@ -72,11 +72,11 @@ namespace Code.Gameplay.Character.Controller
_wallRunningMechanic.WallDetachImpulse = 7.0f;
_wallRunningMechanic.WallContactAngleThreshold = 45.0f;
_wallLeanMechanic = new WallLeanMechanic(
/*_wallLeanMechanic = new WallLeanMechanic(
_characterConfig.maxWallLeanAngle,
_characterConfig.wallLeanSharpness,
_characterConfig.wallLeanHeightScale
);
);*/
_groundMovement = new GroundMovementSystem(
_characterConfig.maxStableMoveSpeed,
_characterConfig.sprintMoveSpeed,
@@ -89,7 +89,7 @@ namespace Code.Gameplay.Character.Controller
motor.CharacterController = this; // Регистрация этого контроллера в движке
_inputHandler.FirstPersonCameraRotation =
motor.Transform.rotation; // Начальное вращение совпадает с персонажемс
_wallLeanMechanic.SetCharacterTransform(characterTransform);
//_wallLeanMechanic.SetCharacterTransform(characterTransform);
_wallRunningMechanic.Initialize(motor, _inputHandler);
}
@@ -191,7 +191,16 @@ namespace Code.Gameplay.Character.Controller
// === WALL RUNNING: обработка состояния ===
if (_wallRunningMechanic.IsWallRunning)
{
_wallRunningMechanic.HandleWallRun(ref currentVelocity, _lastInputs, deltaTime);
// 🔄 Передаём актуальные данные для walljump
if (_groundMovement.JumpRequested) // или _lastInputs.JumpPressed — зависит от логики
{
_wallRunningMechanic.PerformWallJump(_lastInputs, _inputHandler.FirstPersonCameraRotation);
_groundMovement.CancelJumpRequest(); // сброс, чтобы не сработало дважды
}
else
{
_wallRunningMechanic.HandleWallRun(ref currentVelocity, _lastInputs, deltaTime);
}
return;
}
@@ -233,7 +242,7 @@ namespace Code.Gameplay.Character.Controller
public void AfterCharacterUpdate(float deltaTime)
{
_wallLeanMechanic.UpdateLean(motor, deltaTime);
//_wallLeanMechanic.UpdateLean(motor, deltaTime);
}
public bool IsColliderValidForCollisions(Collider coll)
@@ -252,7 +261,7 @@ namespace Code.Gameplay.Character.Controller
// Попытка начать Wall Run при ударе о поверхность
if (_wallRunningMechanic.TryStartWallRun(hitNormal, hitPoint))
{
_wallLeanMechanic.OnWallContact(motor, hitNormal, motor.TransientPosition.y);
//_wallLeanMechanic.OnWallContact(motor, hitNormal, motor.TransientPosition.y);
}
// if (_wallClimbMechanic.TryClimbWall(motor, hitNormal))