Class PuddleRippleEmitter
- Namespace
- DFA.Puddlecraft
Leaves a wake in standing water as this object moves through it: put one on each foot, wheel or anything that wades. It only disturbs water it is actually in, and reports entering and leaving. On the Low quality tier it still reports entering and leaving, but leaves no wake.
[AddComponentMenu("Puddlecraft/Puddle Ripple Emitter")]
[Icon("Packages/com.dfa.puddlecraft/editor/icons/puddle-splat.png")]
public sealed class PuddleRippleEmitter : MonoBehaviour
- Inheritance
-
PuddleRippleEmitter
Fields
onEnterPuddle
Called when the object enters standing water.
[Tooltip("Called when the object enters standing water.")]
public UnityEvent<PuddleHit> onEnterPuddle
Field Value
onExitPuddle
Called when the object leaves standing water.
[Tooltip("Called when the object leaves standing water.")]
public UnityEvent onExitPuddle
Field Value
Properties
contactHeight
How far above the water or ground the object may be and still touch it, in metres (0 or more).
public float contactHeight { get; set; }
Property Value
current
What the object is standing in, valid while inWater is true.
public PuddleHit current { get; }
Property Value
enterSplash
Splash strength when entering water (0 or more). 0 enters without a splash.
public float enterSplash { get; set; }
Property Value
inWater
True while the object is in standing water.
public bool inWater { get; }
Property Value
radius
Radius of the disturbance in metres (at least 0.005): about half a foot or tyre width.
public float radius { get; set; }
Property Value
strength
Wake strength at 1 metre per second (0 or more). Faster movement makes stronger ripples, up to 6 metres per second.
public float strength { get; set; }
Property Value
Methods
Splash(float)
A one-off splash at the object's position, if it is in water, 1.5 times the radius wide. A splashStrength of 1 is a footstep.
public void Splash(float splashStrength = 1)
Parameters
splashStrengthfloat