Class SkidmarkManager
Manages per-wheel skidmark generation, appearance, and lifetime for the vehicle.
Inherited Members
Namespace: NWH.VehiclePhysics2.Effects
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
public class SkidmarkManager : Effect
Fields
fallbackMaterial
Material used when the current surface has no skidmark material assigned or the surface is null.
Declaration
[Tooltip("Material that will be used if no material is assigned to current surface or current surface is null.")]
public Material fallbackMaterial
Field Value
| Type | Description |
|---|---|
| Material |
globalSkidmarkIntensity
Higher value gives darker skidmarks for the same slip.
Declaration
[Range(0, 5)]
[Tooltip("Higher value will give darker skidmarks for the same slip.")]
public float globalSkidmarkIntensity
Field Value
| Type | Description |
|---|---|
| float |
groundOffset
Height above ground at which skidmarks are drawn.
Declaration
[Tooltip("Height above ground at which skidmarks will be drawn.")]
public float groundOffset
Field Value
| Type | Description |
|---|---|
| float |
intensitySmoothing
How fast the skidmark fades in/out. Higher is faster, 10-20 is a good range.
Declaration
[Tooltip("Controls how fast the skidmark fades in/out. Higher = faster response. 10-20 is good.")]
public float intensitySmoothing
Field Value
| Type | Description |
|---|---|
| float |
lowerIntensityThreshold
Below this skidmark alpha the skidmark mesh is not generated.
Declaration
[Tooltip("When the skidmark alpha value is below this value, skidmark mesh will not be generated.")]
public float lowerIntensityThreshold
Field Value
| Type | Description |
|---|---|
| float |
maxSkidmarkAlpha
Max skidmark texture alpha.
Declaration
[Range(0, 1)]
[Tooltip("Max skidmark texture alpha.")]
public float maxSkidmarkAlpha
Field Value
| Type | Description |
|---|---|
| float |
maxTotalTris
Total skidmark mesh triangles per wheel before the oldest section is destroyed.
Declaration
[Tooltip("Total number of skidmark mesh triangles per wheel before the oldest skidmark section gets destroyed.")]
public int maxTotalTris
Field Value
| Type | Description |
|---|---|
| int |
maxTrisPerSection
Triangles drawn per section before the mesh is saved and a new one is generated.
Declaration
[Tooltip("Number of triangles that will be drawn per one section, before mesh is saved and new one is generated.")]
public int maxTrisPerSection
Field Value
| Type | Description |
|---|---|
| int |
minDistance
Distance from the last skidmark section needed to generate a new one.
Declaration
[Tooltip("Distance from the last skidmark section needed to generate a new one.")]
public float minDistance
Field Value
| Type | Description |
|---|---|
| float |
simplifiedShading
Cheap shading path for URP Low / mobile - no specular, procedural relief or breakup.
Declaration
[Tooltip("Cheap shading path for low-end/mobile. Disables specular, procedural relief and breakup.")]
public bool simplifiedShading
Field Value
| Type | Description |
|---|---|
| bool |
skidmarkContainer
Game object that contains all the skidmark objects.
Declaration
[Tooltip("Game object that contains all the skidmark objects.")]
public GameObject skidmarkContainer
Field Value
| Type | Description |
|---|---|
| GameObject |
skidmarkDestroyDistance
Skidmarks are deleted when their distance from the parent vehicle exceeds this.
Declaration
[Tooltip("Skidmarks get deleted when the distance from the parent vehicle is higher than this.")]
public float skidmarkDestroyDistance
Field Value
| Type | Description |
|---|---|
| float |
skidmarkDestroyTime
Time after which the skidmark is destroyed. Set to 0 to disable.
Declaration
[Tooltip("Time after which the skidmark will get destroyed. Set to 0 to disable.")]
public float skidmarkDestroyTime
Field Value
| Type | Description |
|---|---|
| float |
textureLengthMeters
Length in meters over which the skidmark texture tiles along the mark.
Declaration
[Tooltip("Length in meters over which the skidmark texture tiles along the mark.")]
public float textureLengthMeters
Field Value
| Type | Description |
|---|---|
| float |
Methods
SkidmarkUpdateCoroutine()
Per-tick loop that computes slip-based intensity per wheel and drives each generator.
Declaration
public IEnumerator SkidmarkUpdateCoroutine()
Returns
| Type | Description |
|---|---|
| IEnumerator |
VC_Disable(bool)
Disables the component and stops updates. Override to add component-specific disable logic.
Declaration
public override bool VC_Disable(bool calledByParent)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | calledByParent | True if called by parent component or LOD system |
Returns
| Type | Description |
|---|---|
| bool | True if successfully disabled, false otherwise |
Overrides
Remarks
Component must be initialized before it can be disabled. Tracks whether disable was called by parent to manage LOD system interaction.
VC_Enable(bool)
Enables the component and starts updates. Override to add component-specific enable logic.
Declaration
public override bool VC_Enable(bool calledByParent)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | calledByParent | True if called by parent component or LOD system |
Returns
| Type | Description |
|---|---|
| bool | True if successfully enabled, false otherwise |
Overrides
Remarks
Will initialize the component if not already initialized. Components disabled by LOD system will track the parent caller to prevent manual enabling while LOD is controlling state.