軌跡記錄器更改成Raw Input
This commit is contained in:
1 parent
14140797ba
commit
ec0708d05b
17 files changed
+605
-316
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user