Class AirBrakeComponent
Sound of air releasing from pneumatic brake systems found on trucks and buses. Plays a hissing sound when brakes are released, simulating air brake systems. Only triggers when the engine is running. Supports multiple audio clips with random selection for variation.
Inherited Members
Namespace: NWH.VehiclePhysics2.Sound.SoundComponents
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
public class AirBrakeComponent : SoundComponent
Fields
minInterval
Minimum time in seconds that must elapse between successive air brake hiss sounds. Prevents rapid repeated sounds during frequent brake applications.
Declaration
[Tooltip("Minimum time between two plays.")]
public float minInterval
Field Value
| Type | Description |
|---|---|
| float |
Properties
AudioMixerGroup
Gets the Audio Mixer Group this component's AudioSource should output to. Used to route audio through the vehicle's audio mixer for processing and mixing.
Declaration
public override AudioMixerGroup AudioMixerGroup { get; }
Property Value
| Type | Description |
|---|---|
| AudioMixerGroup |
Overrides
ContainerGO
Gets the GameObject container where the AudioSource should be created. Used to position audio sources at specific locations on the vehicle.
Declaration
public override GameObject ContainerGO { get; }
Property Value
| Type | Description |
|---|---|
| GameObject |
Overrides
Priority
Gets the priority level for the AudioSource. Lower values indicate higher priority. Range is 0 (highest) to 256 (lowest). Used by Unity's audio system when the maximum number of audio sources is reached.
Declaration
public override int Priority { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
Methods
PlayBrakeHiss()
Plays the air brake hiss sound when brakes are released. Only plays if minimum interval has elapsed and engine is running. Volume is randomized for variation.
Declaration
public void PlayBrakeHiss()
VC_Disable(bool)
Stops and disables the AudioSource belonging to this SoundComponent.
Declaration
public override bool VC_Disable(bool calledByParent)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | calledByParent |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
VC_Enable(bool)
Enables the AudioSource belonging to this SoundComponent.
Declaration
public override bool VC_Enable(bool calledByParent)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | calledByParent |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
VC_SetDefaults()
Resets the component to default configuration. Override to provide component-specific default values.
Declaration
public override void VC_SetDefaults()
Overrides
Remarks
Called when the vehicle is reset or when first added to a GameObject. Should set all serialized fields to sensible default values. May load default assets from Resources folder.
VC_Update(float)
Frame-rate dependent update called every frame. Override for visual updates and input handling.
Declaration
public override void VC_Update(float DeltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| float | DeltaTime | Time elapsed since last Update in seconds |
Overrides
Remarks
Only called when the component is active (initialized and enabled). Use for visual effects, UI updates, and other frame-dependent operations. Avoid physics calculations here - use VC_FixedUpdate instead.