механики
This commit is contained in:
1 parent
dd5a95a4d3
commit
11d57bec19
129 files changed
+21889
-62
No files matched your search
@@ -1,4 +1,4 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public class CameraFollow : MonoBehaviour
|
||||
@@ -31,8 +31,9 @@ public class CameraFollow : MonoBehaviour
|
||||
// Читаем дельту мыши (смещение курсора за один кадр)
|
||||
Vector2 mouseDelta = mouse.delta.ReadValue();
|
||||
|
||||
yaw += mouseDelta.x * mouseSensitivity * Time.deltaTime;
|
||||
pitch -= mouseDelta.y * mouseSensitivity * Time.deltaTime;
|
||||
float sens = mouseSensitivity * GameSettings.GetMouseSensitivity();
|
||||
yaw += mouseDelta.x * sens * Time.deltaTime;
|
||||
pitch -= mouseDelta.y * sens * Time.deltaTime;
|
||||
|
||||
// Ограничиваем угол наклона камеры
|
||||
pitch = Mathf.Clamp(pitch, -40f, 60f);
|
||||
|
||||
Reference in new issue
Block a user