Class ReverseBeepComponent
Repeating beep warning sound played when vehicle is reversing. Commonly heard on trucks, buses, and construction vehicles. Beeps once per second when active. Can be triggered by reverse gear engagement or backward movement regardless of gear.
Inherited Members
Namespace: NWH.VehiclePhysics2.Sound.SoundComponents
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
public class ReverseBeepComponent : SoundComponent
Fields
beepOnNegativeVelocity
When enabled, beeping occurs whenever the vehicle is moving backward (negative velocity), regardless of the current gear selection. Useful for vehicles that can roll backward in neutral.
Declaration
[Tooltip("Should beeping happen on negative velocity, ignoring the current gear?")]
public bool beepOnNegativeVelocity
Field Value
| Type | Description |
|---|---|
| bool |
beepOnReverseGear
When enabled, beeping occurs when the transmission is in reverse gear (gear less than 0), even if the vehicle is not yet moving backward.
Declaration
[Tooltip("Should beeping happen when in reverse?")]
public bool beepOnReverseGear
Field Value
| Type | Description |
|---|---|
| bool |
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
InitLoop
Gets whether the AudioSource should loop continuously. Override in derived classes to enable looping for continuous sounds like engine running.
Declaration
public override bool InitLoop { get; }
Property Value
| Type | Description |
|---|---|
| bool |
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
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.