Class TransmissionWhineComponent
Straight-cut gearbox whine sound. Pitch follows RPM, volume follows load.
Inherited Members
Namespace: NWH.VehiclePhysics2.Sound.SoundComponents
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
public class TransmissionWhineComponent : SoundComponent
Fields
accelerationIntensity
Whine intensity under acceleration.
Declaration
[Tooltip("Whine intensity under acceleration.")]
[Range(0, 1)]
public float accelerationIntensity
Field Value
| Type | Description |
|---|---|
| float |
coastIntensity
Whine intensity when coasting/engine braking.
Declaration
[Tooltip("Whine intensity when coasting/engine braking.")]
[Range(0, 1)]
public float coastIntensity
Field Value
| Type | Description |
|---|---|
| float |
pitchRange
How much pitch is added from idle to redline.
Declaration
[Range(0, 5)]
[Tooltip("How much pitch is added from Idle to Redline.")]
public float pitchRange
Field Value
| Type | Description |
|---|---|
| float |
referenceMaxRPM
Engine RPM at which the pitch reaches the top of the range.
Declaration
[Tooltip("The Engine RPM at which the pitch reaches the top of the range.")]
public float referenceMaxRPM
Field Value
| Type | Description |
|---|---|
| float |
rpmIntensity
Base whine intensity at idle (no load).
Declaration
[Tooltip("Base whine intensity at idle (no load).")]
[Range(0, 1)]
public float rpmIntensity
Field Value
| Type | Description |
|---|---|
| float |
smoothing
Smoothing speed for pitch and volume changes.
Declaration
[Tooltip("Smoothing speed for pitch and volume changes.")]
[Range(0, 1)]
public float smoothing
Field Value
| Type | Description |
|---|---|
| float |
startPitch
Pitch at idle RPM.
Declaration
[Tooltip("Pitch at idle RPM.")]
[FormerlySerializedAs("basePitch")]
public float startPitch
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
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
InitPlayOnAwake
Gets whether the AudioSource should automatically play on awake.
Declaration
public override bool InitPlayOnAwake { 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_SetDefaults()
Writes default values into every serialized field, and may pull default assets from Resources. Runs on vehicle reset and when the component is first added.
Declaration
public override void VC_SetDefaults()
Overrides
VC_Update(float)
Per-frame update for input, visuals and UI. Only called while the component is active. Physics belongs in VC_FixedUpdate, not here.
Declaration
public override void VC_Update(float DeltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| float | DeltaTime | Time elapsed since last Update in seconds |