This commit is contained in:
Scove
2026-03-27 12:27:50 +07:00
parent d418535a7b
commit df1377206a
7 changed files with 280 additions and 41 deletions

View File

@@ -1,4 +1,5 @@
using UnityEngine;
using static OnlyScove.Scripts.CameraController;
namespace OnlyScove.Scripts
{
@@ -32,9 +33,9 @@ namespace OnlyScove.Scripts
CurrentRotation = cameraTransform.rotation;
}
public void HandleRotation(InputReader inputReader, Transform followTarget, float rotationSmoothTime)
public void HandleRotation(InputReader inputReader, Transform followTarget, float rotationSmoothTime, CameraViewMode viewMode)
{
if (inputReader == null) return;
if (inputReader == null || viewMode == CameraViewMode.FirstPerson) return; // Only process input in TPV
if (inputReader.LookInput.magnitude > 0.01f)
{
@@ -58,7 +59,6 @@ namespace OnlyScove.Scripts
_rotationY = Mathf.LerpAngle(_rotationY, targetYaw, autoRotateSpeed * Time.deltaTime);
}
}
Quaternion targetRotation = Quaternion.Euler(_rotationX, _rotationY, 0f);
CurrentRotation = Quaternion.Slerp(CurrentRotation, targetRotation, rotationSmoothTime * Time.deltaTime);
}