# OnPreviewGUI(Rect, GUIStyle)

> Call this from an Editor.OnPreviewGUI or ObjectPreview.OnPreviewGUI to draw a mesh preview.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.5/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public void OnPreviewGUI(Rect rect, GUIStyle background)
```

### Parameters

**** (\[Rect]\(/engine/6000.5/script-reference/unityengine/rect)): Rectangle in which to draw the preview.**** (\[GUIStyle]\(/engine/6000.5/script-reference/unityengine/guistyle)): The background style.
