Class NOSSoundComponent
Sound component for producing the characteristic 'hiss' sound of active NOS injection.
Inherited Members
Namespace: NWH.VehiclePhysics2.Modules.NOS
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
public class NOSSoundComponent : SoundComponent
Remarks
This component handles the audio feedback for the NOS module, playing a continuous hissing sound while nitrous oxide is being injected into the engine. The sound automatically starts when NOS is activated and stops when deactivated.
The component integrates with the vehicle's sound system and uses the engine sound GameObject and mixer group for consistent audio positioning and processing.
Fields
nosModule
Reference to the parent NOS module that controls this sound component.
Declaration
[NonSerialized]
public NOSModule nosModule
Field Value
| Type | Description |
|---|---|
| NOSModule |
Remarks
Set automatically by the NOSModule during initialization. Used to check the NOS activation state.
Properties
AudioMixerGroup
Gets the audio mixer group for processing the NOS sound.
Declaration
public override AudioMixerGroup AudioMixerGroup { get; }
Property Value
| Type | Description |
|---|---|
| AudioMixerGroup | The engine audio mixer group for sound processing. |
Overrides
Remarks
Uses the engine mixer group to maintain consistent audio processing with other engine-related sounds.
ContainerGO
Gets the container GameObject for the NOS sound source.
Declaration
public override GameObject ContainerGO { get; }
Property Value
| Type | Description |
|---|---|
| GameObject | The engine source GameObject used for NOS sound positioning. |
Overrides
Remarks
Uses the engine source GameObject to ensure the sound originates from the same location as other engine sounds.
InitLoop
Indicates whether to initialize this sound as a looping source.
Declaration
public override bool InitLoop { get; }
Property Value
| Type | Description |
|---|---|
| bool | True to enable looping for continuous playback. |
Overrides
Remarks
NOS sound loops continuously while active to create the sustained hissing effect of pressurized gas release.
Priority
Gets the priority level for this sound component.
Declaration
public override int Priority { get; }
Property Value
| Type | Description |
|---|---|
| int | Priority value of 90 for NOS sound. |
Overrides
Remarks
Priority of 90 ensures NOS sound plays alongside engine sounds without being culled when multiple sound sources are active. Lower values = higher priority (0 is highest).
Methods
VC_SetDefaults()
Sets default values for the NOS sound component.
Declaration
public override void VC_SetDefaults()
Overrides
Remarks
Initializes base volume and attempts to load the default NOS sound clip from resources if no clip is currently assigned.
VC_Update(float)
Updates the NOS sound state based on current NOS activation.
Declaration
public override void VC_Update(float DeltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| float | DeltaTime | Time since last update in seconds. |
Overrides
Remarks
Monitors the NOS module state and controls sound playback accordingly. When NOS is active, sets the volume and starts playback if not already playing. When NOS is inactive, stops the sound.
Called every frame when the sound component is enabled. Provides immediate audio feedback to NOS activation/deactivation.