mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 20:13:02 +00:00
add vehicle turn multiplier
This commit is contained in:
parent
aa160093c3
commit
cdf5b1e981
1 changed files with 6 additions and 0 deletions
|
@ -26,6 +26,8 @@ namespace SanAndreasUnity.UI
|
|||
public Color activeButtonColor = Color.blue;
|
||||
public Color inactiveButtonColor = Color.black;
|
||||
|
||||
public float vehicleTurnMultiplier = 1.5f;
|
||||
|
||||
|
||||
|
||||
void Awake ()
|
||||
|
@ -192,6 +194,10 @@ namespace SanAndreasUnity.UI
|
|||
// ignore y axis
|
||||
input.y = 0;
|
||||
// now input has only x value between -1 and 1
|
||||
// apply multiplier
|
||||
input.x *= this.vehicleTurnMultiplier;
|
||||
// clamp between -1 and 1
|
||||
input.x = Mathf.Clamp(input.x, -1f, 1f);
|
||||
|
||||
this.UpdateMovementInput(turnVehicleButton, input);
|
||||
|
||||
|
|
Loading…
Reference in a new issue