NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    Class NOSSoundComponent

    Sound component for producing the characteristic 'hiss' sound of active NOS injection.

    Inheritance
    object
    VehicleComponent
    SoundComponent
    NOSSoundComponent
    Inherited Members
    SoundComponent.baseVolume
    SoundComponent.clips
    SoundComponent.source
    SoundComponent.InitializeWithNoClips
    SoundComponent.Clip
    SoundComponent.InitClip
    SoundComponent.InitVolume
    SoundComponent.InitSpatialBlend
    SoundComponent.InitDopplerLevel
    SoundComponent.InitPlayOnAwake
    SoundComponent.RandomClip
    SoundComponent.VC_Initialize()
    SoundComponent.CreateAndRegisterAudioSource(AudioMixerGroup, GameObject)
    SoundComponent.VC_Enable(bool)
    SoundComponent.VC_Disable(bool)
    SoundComponent.PlayRandomClip()
    SoundComponent.PlayForDurationCoroutine(int, float)
    SoundComponent.Play()
    SoundComponent.Play(int)
    SoundComponent.SetPitch(float)
    SoundComponent.SetVolume(float)
    SoundComponent.Stop()
    SoundComponent.AddDefaultClip(string)
    VehicleComponent.state
    VehicleComponent.vehicleController
    VehicleComponent.IsActive
    VehicleComponent.VC_Initialize(VehicleController)
    VehicleComponent.VC_FixedUpdate(float)
    VehicleComponent.VC_LoadStateFromStateSettings()
    VehicleComponent.VC_DrawGizmos()
    VehicleComponent.VC_Validate(VehicleController)
    VehicleComponent.UpdateLOD()
    VehicleComponent.ToggleState()
    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
    SoundComponent.AudioMixerGroup
    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
    SoundComponent.ContainerGO
    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
    SoundComponent.InitLoop
    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
    SoundComponent.Priority
    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
    VehicleComponent.VC_SetDefaults()
    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
    VehicleComponent.VC_Update(float)
    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.

    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics