just for syncing changes

This commit is contained in:
MrTorex committed 2025-11-10 22:16:36 +03:00
1 parent 0e188efe59
commit f8448ba922
4 files changed
+34 -412

No files matched your search

@@ -17,6 +17,8 @@ namespace Code.Gameplay.Character.Controller.Abilities
private Vector3 _lastWallNormal;
private float _lastWallContactHeight;
private float _leanFactor;
private float _leanSign;
private Vector3 _leanDirection;
public WallLeanMechanic(float maxLeanAngle, float leanSharpness, float heightScale)
{
@@ -32,10 +34,23 @@ namespace Code.Gameplay.Character.Controller.Abilities
}
// Вызывается из OnMovementHit
public void OnWallContact(Vector3 wallNormal, float contactHeight)
public void OnWallContact(KinematicCharacterMotor motor, Vector3 wallNormal, float contactHeight)
{
_lastWallNormal = wallNormal;
_lastWallContactHeight = contactHeight; }
_lastWallContactHeight = contactHeight;
_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);
Debug.Log("CharacterRight: " + motor.CharacterRight);
Debug.Log(_leanSign);
}
// Обновление каждый кадр
public void UpdateLean(KinematicCharacterMotor motor, float deltaTime)
@@ -66,13 +81,12 @@ namespace Code.Gameplay.Character.Controller.Abilities
return;
}
var leanDirection = -_lastWallNormal;
leanDirection = Vector3.ProjectOnPlane(leanDirection, motor.CharacterUp).normalized;
if (leanDirection.sqrMagnitude < 0.01f) return;
var leanAngle = _leanFactor * _maxLeanAngle;
var leanRotation = Quaternion.AngleAxis(leanAngle, Vector3.Cross(motor.CharacterUp, leanDirection));
if (_leanDirection.sqrMagnitude < 0.01f) return;
var leanAngle = _leanSign * _leanFactor * _maxLeanAngle;
var leanRotation = Quaternion.AngleAxis(leanAngle, Vector3.Cross(motor.CharacterUp, _leanDirection));
_characterTransform.localRotation = leanRotation;
}
}
@@ -225,7 +225,7 @@ namespace Code.Gameplay.Character.Controller
var dotWithUp = Vector3.Dot(hitNormal, motor.CharacterUp);
if (Mathf.Abs(dotWithUp) <= _wallClimbMechanic.WallNormalThreshold)
{
_wallLeanMechanic.OnWallContact(hitNormal, motor.TransientPosition.y);
_wallLeanMechanic.OnWallContact(motor, hitNormal, motor.TransientPosition.y);
}
}
@@ -233,7 +233,7 @@ Transform:
m_GameObject: {fileID: 453575297}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1.395, z: 0.59}
m_LocalPosition: {x: 0, y: 1.395, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -56,316 +56,12 @@ MonoBehaviour:
fontStyleModifier: 0
renderMode: 4165
includeFontFeatures: 0
m_SourceFontFile: {fileID: 12800000, guid: 4c18ae64a0f1d59239a927890bc9aa3f, type: 3}
m_SourceFontFile: {fileID: 0}
m_SourceFontFilePath:
m_AtlasPopulationMode: 1
InternalDynamicOS: 0
m_GlyphTable:
- m_Index: 30
m_Metrics:
m_Width: 51.296875
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 56.703125
m_GlyphRect:
m_X: 10
m_Y: 10
m_Width: 52
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 60
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 10
m_Y: 92
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 67
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 10
m_Y: 174
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 64
m_Metrics:
m_Width: 31.40625
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 36.8125
m_GlyphRect:
m_X: 10
m_Y: 256
m_Width: 33
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 77
m_Metrics:
m_Width: 53.09375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 58.5
m_GlyphRect:
m_X: 10
m_Y: 338
m_Width: 54
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 73
m_Metrics:
m_Width: 52.203125
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 55.984375
m_GlyphRect:
m_X: 62
m_Y: 256
m_Width: 53
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 94
m_Metrics:
m_Width: 51.296875
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 56.703125
m_GlyphRect:
m_X: 79
m_Y: 92
m_Width: 52
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 121
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 81
m_Y: 10
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 134
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 79
m_Y: 174
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 118
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 10
m_Y: 420
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 136
m_Metrics:
m_Width: 51.296875
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 56.703125
m_GlyphRect:
m_X: 10
m_Y: 502
m_Width: 52
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 146
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 79
m_Y: 420
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 88
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 83
m_Y: 338
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 145
m_Metrics:
m_Width: 66.59375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 72
m_GlyphRect:
m_X: 134
m_Y: 256
m_Width: 68
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 127
m_Metrics:
m_Width: 51.296875
m_Height: 81.359375
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 81.359375
m_HorizontalAdvance: 56.703125
m_GlyphRect:
m_X: 150
m_Y: 10
m_Width: 52
m_Height: 82
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 126
m_Metrics:
m_Width: 51.296875
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 56.703125
m_GlyphRect:
m_X: 148
m_Y: 174
m_Width: 52
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
m_CharacterTable:
- m_ElementType: 1
m_Unicode: 68
m_GlyphIndex: 30
m_Scale: 1
- m_ElementType: 1
m_Unicode: 101
m_GlyphIndex: 60
m_Scale: 1
- m_ElementType: 1
m_Unicode: 108
m_GlyphIndex: 67
m_Scale: 1
- m_ElementType: 1
m_Unicode: 105
m_GlyphIndex: 64
m_Scale: 1
- m_ElementType: 1
m_Unicode: 118
m_GlyphIndex: 77
m_Scale: 1
- m_ElementType: 1
m_Unicode: 114
m_GlyphIndex: 73
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1048
m_GlyphIndex: 94
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1075
m_GlyphIndex: 121
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1088
m_GlyphIndex: 134
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1072
m_GlyphIndex: 118
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1090
m_GlyphIndex: 136
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1100
m_GlyphIndex: 146
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1042
m_GlyphIndex: 88
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1099
m_GlyphIndex: 145
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1081
m_GlyphIndex: 127
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1080
m_GlyphIndex: 126
m_Scale: 1
m_GlyphTable: []
m_CharacterTable: []
m_AtlasTextures:
- {fileID: 688428377202190775}
m_AtlasTextureIndex: 0
@@ -376,100 +72,12 @@ MonoBehaviour:
m_AtlasHeight: 1024
m_AtlasPadding: 9
m_AtlasRenderMode: 4165
m_UsedGlyphRects:
- m_X: 0
m_Y: 0
m_Width: 71
m_Height: 82
- m_X: 0
m_Y: 82
m_Width: 69
m_Height: 82
- m_X: 0
m_Y: 164
m_Width: 69
m_Height: 82
- m_X: 0
m_Y: 246
m_Width: 52
m_Height: 82
- m_X: 0
m_Y: 328
m_Width: 73
m_Height: 82
- m_X: 52
m_Y: 246
m_Width: 72
m_Height: 82
- m_X: 69
m_Y: 82
m_Width: 71
m_Height: 82
- m_X: 71
m_Y: 0
m_Width: 69
m_Height: 82
- m_X: 69
m_Y: 164
m_Width: 69
m_Height: 82
- m_X: 0
m_Y: 410
m_Width: 69
m_Height: 82
- m_X: 0
m_Y: 492
m_Width: 71
m_Height: 82
- m_X: 69
m_Y: 410
m_Width: 69
m_Height: 82
- m_X: 73
m_Y: 328
m_Width: 69
m_Height: 82
- m_X: 124
m_Y: 246
m_Width: 87
m_Height: 82
- m_X: 140
m_Y: 0
m_Width: 71
m_Height: 101
- m_X: 138
m_Y: 164
m_Width: 71
m_Height: 82
m_UsedGlyphRects: []
m_FreeGlyphRects:
- m_X: 0
m_Y: 574
m_Width: 1023
m_Height: 449
- m_X: 71
m_Y: 492
m_Width: 952
m_Height: 531
- m_X: 138
m_Y: 410
m_Width: 885
m_Height: 613
- m_X: 142
m_Y: 328
m_Width: 881
m_Height: 695
- m_X: 211
m_Y: 0
m_Width: 812
m_Width: 1023
m_Height: 1023
- m_X: 140
m_Y: 101
m_Width: 883
m_Height: 63
- m_X: 209
m_Y: 101
m_Width: 814
m_Height: 145
m_FontFeatureTable:
m_MultipleSubstitutionRecords: []
m_LigatureSubstitutionRecords: []
@@ -545,9 +153,9 @@ Texture2D:
Hash: 00000000000000000000000000000000
m_IsAlphaChannelOptional: 0
serializedVersion: 4
m_Width: 1024
m_Height: 1024
m_CompleteImageSize: 1048576
m_Width: 1
m_Height: 1
m_CompleteImageSize: 1
m_MipsStripped: 0
m_TextureFormat: 1
m_MipCount: 1
@@ -572,8 +180,8 @@ Texture2D:
m_LightmapFormat: 0
m_ColorSpace: 1
m_PlatformBlob:
image data: 1048576
_typelessdata: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000407090a131313131313131313131313131212121212121212121212121212121212121212110f0d0a0706040100000000000000000000000000000000000000000000000000000407090a1313131313131313131313130e0d0b07030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000407090a13131313131313131313131311070604000000000000000000000000000000000001070b0f111213131313131313131313131313120f0a05000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050b101416172020202020202020202020201f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1e1e1c1a171413110d080100000000000000000000000000000000000000000000050b101416172020202020202020202020201a1a17130e08010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050b101416172020202020202020202020201e1413100c070100000000000000000000000000050c12171b1d1e202020202020202020202020201e1b16100901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Line truncated
image data: 1
_typelessdata: 00
m_StreamData:
serializedVersion: 2
offset: 0