Reference for the guide's inspected package source. The runtime namespace and assembly are ERAGANX.WaterReflection2D. See complete C# scripts for setup and lifecycle context.
Surface and capture methods#
| Public member | Use |
|---|---|
SetReflectionEnabled(bool) | Toggle this surface without deleting its configuration. |
SetSourceCamera(Camera) | Assign camera and update capture configuration. |
SetSurfaceSize(Vector2) | Set destination-plane width/height. |
SetSurfaceShape(Sprite, float = 0.001f) | Set alpha silhouette/cutoff. Null restores a rectangle; no automatic resize. |
SetOutputSorting(int, int) | Output sorting-layer ID/order. Lightweight retains source sorting. |
SetReflectionMode(ReflectionMode) | Planar, LightweightSprite, Cached, Hybrid or Mirror. |
SetMirrorOrientation(enum) | ReflectionMirrorOrientation.Horizontal or Vertical; vertical applies to Mirror. |
SetVisualStyle(enum, int = 32) | ReflectionVisualStyle.Smooth or PixelArt, with Pixels Per Unit. |
SetReflectionQuality(enum) | Apply Low/Medium/High/Ultra numeric defaults; Custom keeps individual values. |
SetReflectionUpdateRate(float) | Cap eligible captures/second; zero means every eligible frame. |
ApplyReflectionPreset(preset) | Copy reusable groups while retaining scene bindings. |
RefreshCachedReflection() / RequestRefresh() | Request fresh cached/static or live content. |
NotifySettingsChanged() | Sanitize/inform renderer after direct structural changes. |
TryValidateConfiguration(out diagnostic) | Return support status and ReflectionDiagnostic, without inspecting rendered pixels. |
Use references to actual surfaces rather than searching for or creating a manager every frame.
Effect methods#
| Public method | Argument order / behavior |
|---|---|
SetVisualEffectsEnabled(bool) | Master optional shader effects. |
SetReflectionStrength(float) / SetReflectionOpacity(float) | Base visibility multipliers, each 0–1. |
SetReflectionColor(Color) | RGBA multiplier; enables Color/Visual Effects. |
SetReflectionTint(Color, float) | Tint color and 0–1 strength; enables tint/effects. |
SetReflectionBrightness(float) / SetReflectionSaturation(float) | Brightness 0–4; saturation 0–2. |
SetReflectionOffset(Vector2) | Local-plane sampling displacement. |
SetWaves(bool, float, float, float, Vector2) | Enabled, amplitude, speed, frequency, direction. |
SetSecondaryWave(bool, float, float, float, Vector2) | Same argument order as primary waves; independently enabled. |
SetWaveSpeed(float) / SetWaveDistortion(float) | Primary speed/amplitude. Distortion also updates WavesEnabled. |
SetRipples(bool, float, float, float, float) | Enabled, amplitude, frequency, speed, scale. |
SetRipplePreset(enum) | ReflectionRipplePreset.Subtle or Strong. |
SetReflectionBlur(bool, float, enum = LowCost) | Enabled, radius in texels, ReflectionBlurQuality. |
SetReflectionFade(bool, bool, float, float, float = 1) | Vertical, horizontal, start, end, intensity. Copies range to both axes. |
SetReflectionEdgeSoftness(bool, float) | Rectangular-edge blend enable and normalized softness. |
NotifyVisualEffectsChanged() | Sanitize direct Effects edits without invalidating scene capture. |
Editable settings groups#
| Group | Scope |
|---|---|
| Capture | Region, IncludedLayers, ExcludedLayers, ObjectFilter, SelectedRenderers, SortingLayerIds, RendererIndex, NearClip, FarClip, BackgroundColor. |
| Effects | Visibility, appearance, distortion, blur, fades and edge settings. |
| Quality | Tier/numeric resolution settings, texture cap, PPU and pixel flags. |
| Optimization | Update rate, visibility skipping, sharing, preview, cache policy/interval and Hybrid layers. |
Use the appropriate notification after direct field changes. Batch structural edits with NotifySettingsChanged; use NotifyVisualEffectsChanged for display effects only. The shape setter can reuse a capture; change size separately when needed.
Diagnostics and events#
Read Diagnostic. Subscribe to DiagnosticChanged(Action<ReflectionDiagnostic>) and ReflectionUpdated(Action<WaterReflectionSurface>), then unsubscribe when the listener is disabled.
The update event reports a completed displayed capture. Configuration acceptance and completed captures do not establish correct image content or performance. Avoid unrelated nested rendering inside capture callbacks.