Static camera state, Scene environments

This commit is contained in:
ThomasCharester committed 2025-10-29 14:13:09 +03:00
1 parent 07ce27618c
commit c6d1c3bffd
9 files changed
+48 -408

No files matched your search

@@ -17,6 +17,7 @@ namespace Code.App.AppStates
Context.InputService.EnableMap(ActionMappings.MainMenu);
Context.CameraStateMachine.SwitchState(CameraMode.Static);
}
private void SceneLoaded()
@@ -113,7 +113,8 @@ namespace Code.Gameplay.Camera.CameraStates
protected abstract void HandlePosition(float deltaTime, float zoomInput, Quaternion targetRotation);
// Обработка вращения камеры на основе пользовательского ввода
protected void HandleRotationInput(float deltaTime, Vector3 rotationInput, out Quaternion targetRotation)
// Теперь виртуальный, чтобы статический режим мог работать как хочет
protected virtual void HandleRotationInput(float deltaTime, Vector3 rotationInput, out Quaternion targetRotation)
{
// Вращение вокруг вертикальной оси (горизонтальный поворот)
var rotationFromInput = Quaternion.Euler(FollowTransform.up * (rotationInput.x * RotationSpeed));
@@ -4,8 +4,7 @@ namespace Code.Gameplay.Camera.CameraStates
{
public class StaticState : BaseCameraState, ICameraState
{
private Transform _target;
private Transform _position;
public Transform LookTarget;
public StaticState(CameraStateMachineContext context) : base(context) { }
public override void EnterState()
@@ -16,12 +15,16 @@ namespace Code.Gameplay.Camera.CameraStates
protected override void HandlePosition(float deltaTime, float zoomInput, Quaternion targetRotation)
{
throw new System.NotImplementedException();
Camera.transform.position = FollowTransform.position;
}
public CameraMode GetCameraMode() => CameraMode.Static;
public CameraMode GetCameraMode()
protected override void HandleRotationInput(float deltaTime, Vector3 rotationInput,
out Quaternion targetRotation)
{
return CameraMode.Static;
if(LookTarget) Camera.transform.LookAt(LookTarget);
targetRotation = Camera.transform.rotation;
}
}
}
@@ -0,0 +1,9 @@
using UnityEngine;
namespace Code.Scenes
{
public abstract class SceneEnvironment : MonoBehaviour
{
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e67772183eee40b0bd3ca806dae98f20
timeCreated: 1761736090
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a1364bdc4fb54b40843a614990de89ad
timeCreated: 1761736163
@@ -0,0 +1,9 @@
using UnityEngine;
namespace Code.Scenes.SceneEnvironments
{
public class MainMenuEnvironment : SceneEnvironment
{
public Transform CameraTarget;
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2e7be1a504f64b20ac431e6e231c1f70
timeCreated: 1761736177
@@ -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