diff --git a/Game/CourierOld/Assets/Code/Gameplay/Character/Controller/Abilities/WallLeanMechanic.cs b/Game/CourierOld/Assets/Code/Gameplay/Character/Controller/Abilities/WallLeanMechanic.cs index a518dff..ff99d1c 100644 --- a/Game/CourierOld/Assets/Code/Gameplay/Character/Controller/Abilities/WallLeanMechanic.cs +++ b/Game/CourierOld/Assets/Code/Gameplay/Character/Controller/Abilities/WallLeanMechanic.cs @@ -41,13 +41,36 @@ namespace Code.Gameplay.Character.Controller.Abilities _leanDirection = -_lastWallNormal; _leanDirection = Vector3.ProjectOnPlane(_leanDirection, motor.CharacterUp).normalized; - - _leanSign = Mathf.Sign(_lastWallNormal.x != 0 - ? Vector3.Dot(_leanDirection, motor.CharacterForward * _lastWallNormal.z) - : Vector3.Dot(_leanDirection, motor.CharacterForward * _lastWallNormal.z)); - - Debug.Log("CharacterUp: " + motor.CharacterUp); - Debug.Log("CharacterForward: " + motor.CharacterForward); + + //TODO: БЛЯТЬ ПОЛНАЯ ХУЙНЯ НАДО ПЕРЕПИСАТЬ С ИФ ЭЛС НУ Я ПОСЛЕ ПУЛА ПРИДУ И ДОДЕЛАЮ + _leanSign = 1; + + if (_leanDirection.x != 0) + { + if ((int)_leanDirection.x == -1 && motor.CharacterRight.x > 0.1f) + _leanSign = -1; + else if ((int)_leanDirection.x == -1 && Mathf.Abs(motor.CharacterRight.x) < 0.1f) + _leanDirection = new Vector3(0, 0, -1); + else if ((int)_leanDirection.x == 1 && motor.CharacterRight.x > 0.1f) + _leanSign = -1; + else if ((int)_leanDirection.x == 1 && Mathf.Abs(motor.CharacterRight.x) < 0.1f) + _leanDirection = new Vector3(0, 0, -1); + } + else if (_leanDirection.z != 0) + { + if ((int)_leanDirection.z == 1 && Mathf.Abs(motor.CharacterRight.z) < 0.1f) + _leanSign = -1; + else if ((int)_leanDirection.z == -1 && motor.CharacterRight.z < -0.1f) + _leanDirection = new Vector3(-1, 0, 0); + else if ((int)_leanDirection.z == -1 && motor.CharacterRight.z > 0.1f) + _leanDirection = new Vector3(1, 0, 0); + else if ((int)_leanDirection.z == 1 && motor.CharacterRight.z < -0.1f) + _leanDirection = new Vector3(1, 0, 0); + else if ((int)_leanDirection.z == 1 && motor.CharacterRight.z > 0.1f) + _leanDirection = new Vector3(-1, 0, 0); + } + + Debug.Log("LeanDirection: " + _leanDirection); Debug.Log("CharacterRight: " + motor.CharacterRight); Debug.Log(_leanSign); } diff --git a/Game/CourierOld/Assets/Resources/Scenes/MovementDev.unity b/Game/CourierOld/Assets/Resources/Scenes/MovementDev.unity index e2a58c4..d427220 100644 --- a/Game/CourierOld/Assets/Resources/Scenes/MovementDev.unity +++ b/Game/CourierOld/Assets/Resources/Scenes/MovementDev.unity @@ -522,7 +522,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -10, y: 3, z: 0} - m_LocalScale: {x: 2, y: 6, z: 10} + m_LocalScale: {x: 10, y: 6, z: 10} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0}