Main question
I’m building a custom Terrain editor, and I can’t determine how to get a projection of the ‘brush’ to flow over the terrain like the built-in Unity terrain editor.
At the moment of I’m using Handles.DrawLines
, function to render a square, but this doesn’t “hug” the terrain shape.
I looked through the scripting API, but didn’t find anything else in Handles
, EditorUtility
, or EditorGUIUtility
that might be useful. I could possibly create a game object in the editor that projects onto the terrain, but not sure if you can hide it, unless I can somehow create non-permanent objects in OnSceneGUI
. I could maybe use some kind of Gizmo
but that looked like it was just for static renderings around the gameobject when it’s rendered / didn’t look like there was an option for mouse movement.
Random side blurb
Does anyone know of a good resource for creating custom Unity Editor functionality? I’ve been struggling to find any kind of explanation for how to do anything beyond adding a custom property to the inspector window. This is one of the things holding me back from actually developing in Unity, because I haven’t been able to learn methods to create custom tooling in order to remove repetitive tasks.
Example questions
- Can I create instance variables in an Editor class? Is that safe?
- The question I’m asking now about creating the projection