Class WaterParticleSystem
Generates water spray and splash particles based on WaterObject simulation data. Emits particles at the waterline where triangles intersect the water surface. Particle emission is controlled by object velocity and triangle forces. Requires a ParticleSystem component.
Namespace: NWH.DWP2.WaterObjects
Assembly: NWH.DWP2.dll
Syntax
[RequireComponent(typeof(ParticleSystem))]
public class WaterParticleSystem : MonoBehaviour
Fields
| Edit this page View SourceReferenceWaterObject
WaterObject to read simulation data from. Will auto-detect from parent if not assigned.
Declaration
public WaterObject ReferenceWaterObject
Field Value
| Type | Description |
|---|---|
| WaterObject |
emit
Should the particle system emit?
Declaration
[Tooltip("Should the particle system emit?")]
public bool emit
Field Value
| Type | Description |
|---|---|
| bool |
emitPerCycle
How many particles should be emitted each 'emitTimeInterval' seconds.
Declaration
[Tooltip("How many particles should be emitted each 'emitTimeInterval' seconds.")]
[Range(0, 20)]
public int emitPerCycle
Field Value
| Type | Description |
|---|---|
| int |
emitTimeInterval
Determines how often the particles will be emitted.
Declaration
[Tooltip("Determines how often the particles will be emitted.")]
[Range(0, 0.1)]
public float emitTimeInterval
Field Value
| Type | Description |
|---|---|
| float |
initialAlphaModifier
Multiplies initial alpha by this value. Alpha cannot be higher than maxInitialAlpha.
Declaration
[Tooltip("Multiplies initial alpha by this value. Alpha cannot be higher than maxInitialAlpha.")]
[Range(0, 10)]
public float initialAlphaModifier
Field Value
| Type | Description |
|---|---|
| float |
initialVelocityModifier
Determines how much velocity of the object will affect initial particle speed.
Declaration
[Tooltip("Determines how much velocity of the object will affect initial particle speed.")]
[Range(0, 5)]
public float initialVelocityModifier
Field Value
| Type | Description |
|---|---|
| float |
maxInitialAlpha
Limit initial alpha to this value.
Declaration
[Tooltip("Limit initial alpha to this value.")]
[Range(0, 1)]
public float maxInitialAlpha
Field Value
| Type | Description |
|---|---|
| float |
positionExtrapolationFrames
Number of frames ahead to predict particle emission position. Higher values spawn particles ahead of the object for better visual continuity.
Declaration
[Tooltip("Script will try to predict where the object will be in the next n frames.")]
public int positionExtrapolationFrames
Field Value
| Type | Description |
|---|---|
| int |
renderQueue
Render queue of the particle material.
Declaration
[Tooltip("Render queue of the particle material.")]
public int renderQueue
Field Value
| Type | Description |
|---|---|
| int |
sleepThresholdVelocity
Velocity object has to have to emit particles.
Declaration
[FormerlySerializedAs("sleepTresholdVelocity")]
[Tooltip("Velocity object has to have to emit particles.")]
[Range(0.1, 5)]
public float sleepThresholdVelocity
Field Value
| Type | Description |
|---|---|
| float |
startSize
Initial size of the particle.
Declaration
[Tooltip("Initial size of the particle.")]
[Range(0, 64)]
public float startSize
Field Value
| Type | Description |
|---|---|
| float |
surfaceElevation
Elevation above water at which the particles will spawn. Used to avoid clipping.
Declaration
[Tooltip("Elevation above water at which the particles will spawn. Used to avoid clipping.")]
[Range(0, 0.1)]
public float surfaceElevation
Field Value
| Type | Description |
|---|---|
| float |