new cars and maps
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Sandbox;
|
||||
|
||||
namespace VeloX;
|
||||
|
||||
public class InputResolver
|
||||
{
|
||||
public Connection Driver { get; internal set; }
|
||||
@@ -30,6 +31,27 @@ public class InputResolver
|
||||
return IsDriverActive && Input.Down( action );
|
||||
}
|
||||
|
||||
public float Brake
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( Input.UsingController )
|
||||
return Input.GetAnalog( InputAnalog.LeftTrigger );
|
||||
|
||||
return Input.Down( "Brake" ) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
public float Throttle
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( Input.UsingController )
|
||||
return Input.GetAnalog( InputAnalog.RightTrigger );
|
||||
|
||||
return Input.Down( "Throttle" ) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Pressed( string action )
|
||||
{
|
||||
return IsDriverActive && Input.Pressed( action );
|
||||
@@ -40,6 +62,11 @@ public class InputResolver
|
||||
return IsDriverActive && Input.Released( action );
|
||||
}
|
||||
|
||||
public float GetAnalog( InputAnalog analog )
|
||||
{
|
||||
return IsDriverActive ? Input.GetAnalog( analog ) : 0f;
|
||||
}
|
||||
|
||||
public void TriggerHaptics( float leftMotor, float rightMotor, float leftTrigger = 0f, float rightTrigger = 0f, int duration = 500 )
|
||||
{
|
||||
if ( IsDriverActive )
|
||||
|
||||
Reference in New Issue
Block a user