Move "turn speed" setting to PedManager

This commit is contained in:
in0finite 2019-06-23 01:48:57 +02:00
parent 9fbd976388
commit b4fa58650f
3 changed files with 6 additions and 4 deletions

View file

@ -479,7 +479,7 @@ namespace SanAndreasUnity.Behaviours
{ {
// rotate player towards his heading // rotate player towards his heading
Vector3 forward = Vector3.RotateTowards (this.transform.forward, Heading, TurnSpeed * Time.deltaTime, 0.0f); Vector3 forward = Vector3.RotateTowards (this.transform.forward, Heading, PedManager.Instance.pedTurnSpeed * Time.deltaTime, 0.0f);
this.transform.rotation = Quaternion.LookRotation(forward); this.transform.rotation = Quaternion.LookRotation(forward);
} }

View file

@ -10,6 +10,8 @@ namespace SanAndreasUnity.Behaviours
public GameObject pedPrefab; public GameObject pedPrefab;
public float pedTurnSpeed = 10f;
[Header("Health bar")] [Header("Health bar")]
public bool displayHealthBarAbovePeds = false; public bool displayHealthBarAbovePeds = false;

View file

@ -11,9 +11,9 @@ namespace SanAndreasUnity.Settings {
description = "Turn speed", description = "Turn speed",
minValue = 3, minValue = 3,
maxValue = 30, maxValue = 30,
isAvailable = () => Ped.Instance != null, isAvailable = () => PedManager.Instance != null,
getValue = () => Ped.Instance.TurnSpeed, getValue = () => PedManager.Instance.pedTurnSpeed,
setValue = (value) => { Ped.Instance.TurnSpeed = value; }, setValue = (value) => { PedManager.Instance.pedTurnSpeed = value; },
}; };
OptionsWindow.FloatInput m_enterVehicleRadiusInput = new OptionsWindow.FloatInput() { OptionsWindow.FloatInput m_enterVehicleRadiusInput = new OptionsWindow.FloatInput() {
description = "Enter vehicle radius", description = "Enter vehicle radius",