# OnRenderBrushPreview(Terrain, IOnSceneGUI)

> Use this method to implement custom tool preview and UI behavior that will only render while the mouse is within the SceneView bounds or while you're actively using this tool.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.TerrainTools](/engine/6000.7/script-reference/unityeditor/terraintools.md)
* **Assembly:** UnityEditor

```csharp
public virtual void OnRenderBrushPreview(Terrain terrain, IOnSceneGUI editContext)
```

### Parameters

**** (\[Terrain]\(/engine/6000.7/script-reference/unityengine/terrain)): Active Terrain object.**** (\[IOnSceneGUI]\(/engine/6000.7/script-reference/unityeditor/terraintools/ionscenegui)): Interface for communication between Editor and Paint tools.

### Remarks

Unity calls this method when the mouse is within the [SceneView](/engine/6000.7/script-reference/unityeditor/sceneview.md) viewport bounds, and the hotControl is set to 0 or to the [Terrain](/engine/6000.7/script-reference/unityengine/terrain.md) control ID provided by the [IOnSceneGUI](/engine/6000.7/script-reference/unityeditor/terraintools/ionscenegui.md) context instance. This is usually when no other tools are active, or when you're actively using this tool.

Additional Resources: [Editor.OnSceneGUI()](/engine/6000.7/script-reference/unityeditor/editor/onscenegui.md), [SceneView](/engine/6000.7/script-reference/unityeditor/sceneview.md), [TerrainPaintTool\<T>.OnSceneGUI](/engine/6000.7/script-reference/unityeditor/terraintools/terrainpainttool1/onscenegui.md), hotControl, [GUIUtility.hotControl](/engine/6000.7/script-reference/unityengine/guiutility/hotcontrol.md).
