decals
This commit is contained in:
parent
ab8cc70785
commit
97fcb29bc0
@ -105,15 +105,15 @@ public abstract partial class VeloXBase
|
|||||||
}
|
}
|
||||||
private void UpdateInput()
|
private void UpdateInput()
|
||||||
{
|
{
|
||||||
VerticalInput = TotalSpeed < 10 ? Input.AnalogMove.x * 0.5f : Input.AnalogMove.x;
|
VerticalInput = Input.AnalogMove.x;
|
||||||
Handbrake = Input.Down( "Jump" ) ? 1 : 0;
|
Handbrake = Input.Down( "Handbrake" ) ? 1 : 0;
|
||||||
|
|
||||||
SteeringAngle = Input.AnalogMove.y;
|
SteeringAngle = Input.AnalogMove.y;
|
||||||
|
|
||||||
IsClutching = (Input.Down( "Run" ) || Input.Down( "Jump" )) ? 1 : 0;
|
IsClutching = Input.Down( "Clutch" ) ? 1 : 0;
|
||||||
|
|
||||||
IsShiftingUp = Input.Pressed( "Attack1" );
|
IsShiftingUp = Input.Pressed( "Shift Up" );
|
||||||
IsShiftingDown = Input.Pressed( "Attack2" );
|
IsShiftingDown = Input.Pressed( "Shift Down" );
|
||||||
|
|
||||||
if ( TotalSpeed < 150 && Driver is null )
|
if ( TotalSpeed < 150 && Driver is null )
|
||||||
Handbrake = 1;
|
Handbrake = 1;
|
||||||
@ -143,6 +143,13 @@ public abstract partial class VeloXBase
|
|||||||
Input.TriggerHaptics( leftMotor, rightMotor, leftTrigger, rightTrigger, duration );
|
Input.TriggerHaptics( leftMotor, rightMotor, leftTrigger, rightTrigger, duration );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void TriggerHaptics( HapticEffect effect, float lengthScale = 1, float frequencyScale = 1, float amplitudeScale = 1 )
|
||||||
|
{
|
||||||
|
if ( IsDriverActive )
|
||||||
|
{
|
||||||
|
Input.TriggerHaptics( effect, lengthScale, frequencyScale, amplitudeScale );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void StopAllHaptics()
|
public void StopAllHaptics()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -52,11 +52,13 @@ public abstract partial class VeloXBase : Component, Component.ICollisionListene
|
|||||||
{
|
{
|
||||||
var hardSound = Sound.Play( HardCollisionSound, WorldPosition );
|
var hardSound = Sound.Play( HardCollisionSound, WorldPosition );
|
||||||
hardSound.Volume = volume;
|
hardSound.Volume = volume;
|
||||||
|
TriggerHaptics( HapticEffect.HardImpact );
|
||||||
}
|
}
|
||||||
else if ( surfaceNormal.Dot( -collision.Contact.Speed.Normal ) < 0.5f )
|
else if ( surfaceNormal.Dot( -collision.Contact.Speed.Normal ) < 0.5f )
|
||||||
{
|
{
|
||||||
var scrapSound = Sound.Play( VehicleScrapeSound, WorldPosition );
|
var scrapSound = Sound.Play( VehicleScrapeSound, WorldPosition );
|
||||||
scrapSound.Volume = 0.4f;
|
scrapSound.Volume = 0.4f;
|
||||||
|
TriggerHaptics( HapticEffect.SoftImpact );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,20 @@ public class InputResolver
|
|||||||
public Vector2 MouseDelta => IsDriverActive ? Input.MouseDelta : default;
|
public Vector2 MouseDelta => IsDriverActive ? Input.MouseDelta : default;
|
||||||
public Vector2 MouseWheel => IsDriverActive ? Input.MouseWheel : default;
|
public Vector2 MouseWheel => IsDriverActive ? Input.MouseWheel : default;
|
||||||
public Angles AnalogLook => IsDriverActive ? Input.AnalogLook : default;
|
public Angles AnalogLook => IsDriverActive ? Input.AnalogLook : default;
|
||||||
public Vector3 AnalogMove => IsDriverActive ? Input.AnalogMove : default;
|
public Vector3 AnalogMove
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if ( Input.UsingController )
|
||||||
|
{
|
||||||
|
Vector2 input = 0;
|
||||||
|
input.x = Input.GetAnalog( InputAnalog.RightTrigger ) - Input.GetAnalog( InputAnalog.LeftTrigger );
|
||||||
|
input.y = -Input.GetAnalog( InputAnalog.LeftStickX );
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
return IsDriverActive ? Input.AnalogMove : default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool Down( string action )
|
public bool Down( string action )
|
||||||
{
|
{
|
||||||
@ -34,6 +47,13 @@ public class InputResolver
|
|||||||
Input.TriggerHaptics( leftMotor, rightMotor, leftTrigger, rightTrigger, duration );
|
Input.TriggerHaptics( leftMotor, rightMotor, leftTrigger, rightTrigger, duration );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void TriggerHaptics( HapticEffect effect, float lengthScale = 1, float frequencyScale = 1, float amplitudeScale = 1 )
|
||||||
|
{
|
||||||
|
if ( IsDriverActive )
|
||||||
|
{
|
||||||
|
Input.TriggerHaptics( effect, lengthScale, frequencyScale, amplitudeScale );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void StopAllHaptics()
|
public void StopAllHaptics()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user