mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-16 21:08:28 +00:00
adapt mouse sensitivity
This commit is contained in:
parent
90bb9ccb15
commit
a6bb7969b6
3 changed files with 11 additions and 7 deletions
|
@ -21,6 +21,8 @@ namespace SanAndreasUnity.Behaviours {
|
|||
|
||||
[SerializeField] [Range(10, 100)] private int m_defaultMaxFps = 60;
|
||||
|
||||
public Vector2 cursorSensitivity = new Vector2(2f, 2f);
|
||||
|
||||
|
||||
/// <summary> Are we in a startup scene ? </summary>
|
||||
public static bool IsInStartupScene { get { return UnityEngine.SceneManagement.SceneManager.GetActiveScene ().buildIndex == 0; } }
|
||||
|
|
|
@ -207,7 +207,7 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
Vector2 totalMouseDelta = mouseDelta + rightAnalogDelta;
|
||||
|
||||
totalMouseDelta = Vector2.Scale (totalMouseDelta, this.CursorSensitivity);
|
||||
totalMouseDelta = Vector2.Scale (totalMouseDelta, GameManager.Instance.cursorSensitivity);
|
||||
|
||||
m_ped.MouseMoveInput = totalMouseDelta;
|
||||
|
||||
|
|
|
@ -37,17 +37,19 @@ namespace SanAndreasUnity.Settings {
|
|||
description = "Mouse sensitivity x",
|
||||
minValue = 0.2f,
|
||||
maxValue = 10f,
|
||||
isAvailable = () => PlayerController.Instance != null,
|
||||
getValue = () => PlayerController.Instance.CursorSensitivity.x,
|
||||
setValue = (value) => { PlayerController.Instance.CursorSensitivity.x = value; },
|
||||
isAvailable = () => GameManager.Instance != null,
|
||||
getValue = () => GameManager.Instance.cursorSensitivity.x,
|
||||
setValue = (value) => { GameManager.Instance.cursorSensitivity.x = value; },
|
||||
persistType = OptionsWindow.InputPersistType.OnStart,
|
||||
};
|
||||
OptionsWindow.FloatInput m_mouseSensitivityYInput = new OptionsWindow.FloatInput() {
|
||||
description = "Mouse sensitivity y",
|
||||
minValue = 0.2f,
|
||||
maxValue = 10f,
|
||||
isAvailable = () => PlayerController.Instance != null,
|
||||
getValue = () => PlayerController.Instance.CursorSensitivity.y,
|
||||
setValue = (value) => { PlayerController.Instance.CursorSensitivity.y = value; },
|
||||
isAvailable = () => GameManager.Instance != null,
|
||||
getValue = () => GameManager.Instance.cursorSensitivity.y,
|
||||
setValue = (value) => { GameManager.Instance.cursorSensitivity.y = value; },
|
||||
persistType = OptionsWindow.InputPersistType.OnStart,
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue