新增軌跡記錄器與匯出至unity內(滑鼠軌跡本身將改為raw input)
This commit is contained in:
1 parent
9e8b520bec
commit
14140797ba
30 files changed
+2299
-22
No files matched your search
@@ -65,6 +65,12 @@ public class PlayerLook : MonoBehaviour
|
||||
timeSinceRecoil = 0f;
|
||||
}
|
||||
|
||||
// ===== 給記錄器用 =====
|
||||
public float Yaw => yaw; // 滑鼠 + 輔助累積的水平角度 (度),不含後座力
|
||||
public float Pitch => -pitch; // 同上的垂直角度,往上為正
|
||||
public Vector2 LastMouseDelta { get; private set; } // 這一幀玩家的滑鼠位移 (滑鼠單位)
|
||||
public Vector2 LastAssistDelta { get; private set; } // 這一幀平滑跟槍加的量 (滑鼠單位)
|
||||
|
||||
// =============================
|
||||
|
||||
void Start()
|
||||
@@ -84,7 +90,11 @@ public class PlayerLook : MonoBehaviour
|
||||
|
||||
void Update()
|
||||
{
|
||||
Vector2 mouseDelta = Mouse.current != null ? Mouse.current.delta.ReadValue() : Vector2.zero;
|
||||
// 暫停時不讀滑鼠,視角不會跟著轉
|
||||
Vector2 mouseDelta = Mouse.current != null && !PauseMenu.IsPaused ? Mouse.current.delta.ReadValue() : Vector2.zero;
|
||||
|
||||
LastMouseDelta = mouseDelta;
|
||||
LastAssistDelta = pendingAssistDelta;
|
||||
|
||||
// 玩家輸入套用 (可被動態靈敏度改變) + 輔助位移
|
||||
Vector2 totalDelta = mouseDelta * sensitivityScale + pendingAssistDelta;
|
||||
|
||||
Reference in new issue
Block a user