軌跡記錄器更改成Raw Input

This commit is contained in:
Sahik committed 2026-10-23 03:42:16 +08:00
1 parent 14140797ba
commit ec0708d05b
17 files changed
+605 -316

No files matched your search

+6 -13
View File
@@ -1,6 +1,5 @@
using UnityEngine;
using TMPro;
using UnityEngine.InputSystem;
public class Movement : MonoBehaviour
{
@@ -17,22 +16,16 @@ public class Movement : MonoBehaviour
void Update()
{
if (Mouse.current != null)
{
Vector2 currentDelta = Mouse.current.delta.ReadValue();
// 跟遊戲內視角讀同一份 Raw Input 的位移
Vector2 currentDelta = RawMouseInput.FrameDelta;
if (smoothedDelta == Vector2.zero)
{
smoothedDelta = currentDelta;
}
else
{
smoothedDelta = (alpha * currentDelta) + ((1.0f - alpha) * smoothedDelta);
}
if (smoothedDelta == Vector2.zero)
{
smoothedDelta = currentDelta;
}
else
{
smoothedDelta = Vector2.zero;
smoothedDelta = (alpha * currentDelta) + ((1.0f - alpha) * smoothedDelta);
}
displayTimer += Time.unscaledDeltaTime;