# OnGUI

> Draws a custom GUI for the property with a label that can include a tooltip and an icon.

## Definition

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

## OnGUI(Rect, MaterialProperty, GUIContent, MaterialEditor)

Draws a custom GUI for the property with a label that can include a tooltip and an icon.

```csharp
public virtual void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor)
```

### Parameters

**** (\[Rect]\(/engine/7000.0/script-reference/unityengine/rect)): Rectangle on the screen to use for the property GUI.**** (\[MaterialProperty]\(/engine/7000.0/script-reference/unityeditor/materialproperty)): The [MaterialProperty](/engine/7000.0/script-reference/unityeditor/materialproperty.md) to make the custom GUI for.**** (\[GUIContent]\(/engine/7000.0/script-reference/unityengine/guicontent)): The label of this property, as a [GUIContent](/engine/7000.0/script-reference/unityengine/guicontent.md).**** (\[MaterialEditor]\(/engine/7000.0/script-reference/unityeditor/materialeditor)): Current material editor.

### Remarks

Override this overload to use the full label content, including its tooltip and icon. By default, it passes only the label text to the overload that takes a string label. If you override neither overload, the drawer shows "No GUI Implemented".

## OnGUI(Rect, MaterialProperty, string, MaterialEditor)

Override this method to make your own GUI for the property.

```csharp
public virtual void OnGUI(Rect position, MaterialProperty prop, string label, MaterialEditor editor)
```

### Parameters

**** (\[Rect]\(/engine/7000.0/script-reference/unityengine/rect)): Rectangle on the screen to use for the property GUI.**** (\[MaterialProperty]\(/engine/7000.0/script-reference/unityeditor/materialproperty)): The [MaterialProperty](/engine/7000.0/script-reference/unityeditor/materialproperty.md) to make the custom GUI for.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The label of this property.**** (\[MaterialEditor]\(/engine/7000.0/script-reference/unityeditor/materialeditor)): Current material editor.
