Static camera state, Scene environments
This commit is contained in:
1 parent
07ce27618c
commit
c6d1c3bffd
9 files changed
+48
-408
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user