Class ExhaustSmoke
Controls particle emitters that represent exhaust smoke based on engine state.
Inherited Members
Namespace: NWH.VehiclePhysics2.Effects
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
public class ExhaustSmoke : Effect
Remarks
Emission rate, start size and start speed scale from the authored values by rpmPercent up to their max multipliers. Scaling is anchored at zero RPM, so idle already sits above the authored values. Colour lerps from normalColor toward sootColor with engine load times sootIntensity. The particle systems play and stop with the engine.
Fields
maxRateMultiplier
Maximum multiplier for particle emission rate at redline RPM. Multiplier is 1.0 at zero RPM and scales linearly with rpmPercent to this value at the rev limiter.
Declaration
[Range(1, 10)]
[Tooltip("Particle emission rate is multiplied by this value based on engine RPM.")]
public float maxRateMultiplier
Field Value
| Type | Description |
|---|---|
| float |
maxSizeMultiplier
Maximum multiplier for particle start size at redline RPM. Multiplier is 1.0 at zero RPM and scales linearly with rpmPercent to this value at the rev limiter.
Declaration
[Range(1, 5)]
[Tooltip("Particle start size is multiplied by this value based on engine RPM.")]
public float maxSizeMultiplier
Field Value
| Type | Description |
|---|---|
| float |
maxSpeedMultiplier
Maximum multiplier for particle start speed at redline RPM. Multiplier is 1.0 at zero RPM and scales linearly with rpmPercent to this value at the rev limiter.
Declaration
[Range(1, 5)]
[Tooltip("Particle start speed is multiplied by this value based on engine RPM.")]
public float maxSpeedMultiplier
Field Value
| Type | Description |
|---|---|
| float |
normalColor
Colour at zero engine load: idle, coasting, light throttle. Lerps toward sootColor as load comes on.
Declaration
[Tooltip("Normal particle start color. Used when there is no throttle - engine is under no load.")]
public Color normalColor
Field Value
| Type | Description |
|---|---|
| Color |
particleSystems
List of exhaust particle systems.
Declaration
[Tooltip("List of exhaust particle systems.")]
public List<ParticleSystem> particleSystems
Field Value
| Type | Description |
|---|---|
| List<ParticleSystem> |
sootColor
Colour at full engine load. Reached only when sootIntensity is 1; otherwise the lerp stops short of it.
Declaration
[Tooltip("Soot particle start color. Used under heavy throttle - engine is under load.")]
public Color sootColor
Field Value
| Type | Description |
|---|---|
| Color |
sootIntensity
How far the colour travels toward sootColor at full load. 0 pins the smoke at normalColor. Raise it for diesels and older engines that visibly smoke under acceleration.
Declaration
[Range(0, 1)]
[Tooltip("How much soot is emitted when the throttle is pressed?")]
public float sootIntensity
Field Value
| Type | Description |
|---|---|
| float |
Methods
VC_Disable(bool)
Disables the component and stops its updates.
Declaration
public override bool VC_Disable(bool calledByParent)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | calledByParent | True when called by a parent ManagerVehicleComponent fan-out or the VehicleController enable/disable loop. The LOD system passes false. |
Returns
| Type | Description |
|---|---|
| bool | True if successfully disabled, false otherwise |
Overrides
Remarks
Refused on a component that is not initialized. Records whether the call came from a parent, which is what VC_Enable checks before a bulk re-enable.
VC_Enable(bool)
Enables the component and starts its updates.
Declaration
public override bool VC_Enable(bool calledByParent)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | calledByParent | True when called by a parent ManagerVehicleComponent fan-out or the VehicleController enable/disable loop. The LOD system passes false. |
Returns
| Type | Description |
|---|---|
| bool | True if successfully enabled, false otherwise |
Overrides
Remarks
Initializes the component first if it is not initialized yet. A parent bulk enable is refused unless the last disable also came from a parent, so it cannot resurrect a component turned off by LOD, by a script, or disabled in StateSettings.
VC_Initialize()
One-time setup, once per vehicle startup and after the VehicleController reference is set. Sets state.initialized on completion; an override that fails must leave it false.
Declaration
protected override void VC_Initialize()
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 |