Editor Water Object Helper
Automatically reloads textures on WaterObject instances when texture-related inspector fields are changed in the editor.
Automatically reloads textures on WaterObject instances when texture-related inspector fields are changed in the editor.
Public Interface
Editor Hooks
| Hook | Signature | Description |
|---|---|---|
onEditorInspectorFieldChanged | (selectedIds, fieldName, fieldValue, arrayIndex) | Fires when any inspector field changes. Checks if the field is a water texture property and reloads textures on matching WaterObject instances. |
Monitored Fields
The hook responds to changes on these field names:
| Field | Description |
|---|---|
rippleTex | Water surface ripple texture |
foamTex | Foam/spray texture |
depthGradientTex | Depth-based color gradient texture |
cubemap | Environment reflection cubemap |
Internal Logic
-- For each selected object, if the changed field is a water texture field:
local function onEditorInspectorFieldChanged(selectedIds, fieldName, fieldValue, arrayIndex)
for i = 1, #selectedIds do
if fieldName == "rippleTex" or fieldName == "foamTex"
or fieldName == "depthGradientTex" or fieldName == "cubemap" then
local object = scenetree.findObjectById(selectedIds[i])
if object:isSubClassOf("WaterObject") then
object:reloadTextures() -- live-preview the new texture
end
end
end
endUsage Context
This extension is loaded automatically by the editor. When a level designer changes a water texture field in the World Editor inspector, the water surface updates immediately without requiring a level reload.
-- No direct API usage needed - operates via editor hook system.
-- The extension triggers automatically when editing WaterObject properties.Additional Exports
M.onEditorInspectorFieldChanged
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Editor Viz Helper
Provides an in-editor visual helper tool for level designers to place temporary decal markers on surfaces. Uses dynamic decals from `art/vizhelper/` with mouse-driven placement, rotation, and scaling
Editor Windows Manager
Provides a utility window that lists all registered editor windows and allows resetting their positions. Useful when a window is dragged off-screen or lost.