# GetPropertyHeight

> Get the height needed for a EditorGUI.PropertyField control.

## Definition

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

## GetPropertyHeight(SerializedPropertyType, GUIContent)

Get the height needed for a [EditorGUI.PropertyField](/engine/6000.0/script-reference/unityeditor/editorgui/propertyfield.md) control.

```csharp
public static float GetPropertyHeight(SerializedPropertyType type, GUIContent label)
```

### Parameters

**** (\[SerializedPropertyType]\(/engine/6000.0/script-reference/unityeditor/serializedpropertytype)): **** (\[GUIContent]\(/engine/6000.0/script-reference/unityengine/guicontent)): Descriptive text or image.

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) |             |

### Remarks

The height is based on the type of the SerializedProperty, and inclues the height of all expanded children if the includeChildren parameter is set to true, which is the default. If the property has a custom PropertyDrawer, the function will return the height returned by that drawer. The includeChildren parameter is ignored in that case, as PropertyDrawers always include children.

## GetPropertyHeight(SerializedProperty, bool)

Get the height needed for a [EditorGUI.PropertyField](/engine/6000.0/script-reference/unityeditor/editorgui/propertyfield.md) control.

```csharp
public static float GetPropertyHeight(SerializedProperty property, bool includeChildren)
```

### Parameters

**** (\[SerializedProperty]\(/engine/6000.0/script-reference/unityeditor/serializedproperty)): Height of the property area.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Should the returned height include the height of child properties?

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) |             |

### Remarks

The height is based on the type of the SerializedProperty, and inclues the height of all expanded children if the includeChildren parameter is set to true, which is the default. If the property has a custom PropertyDrawer, the function will return the height returned by that drawer. The includeChildren parameter is ignored in that case, as PropertyDrawers always include children.

## GetPropertyHeight(SerializedProperty, GUIContent, bool)

Get the height needed for a [EditorGUI.PropertyField](/engine/6000.0/script-reference/unityeditor/editorgui/propertyfield.md) control.

```csharp
public static float GetPropertyHeight(SerializedProperty property, GUIContent label, bool includeChildren)
```

### Parameters

**** (\[SerializedProperty]\(/engine/6000.0/script-reference/unityeditor/serializedproperty)): Height of the property area.**** (\[GUIContent]\(/engine/6000.0/script-reference/unityengine/guicontent)): Descriptive text or image.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Should the returned height include the height of child properties?

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) |             |

### Remarks

The height is based on the type of the SerializedProperty, and inclues the height of all expanded children if the includeChildren parameter is set to true, which is the default. If the property has a custom PropertyDrawer, the function will return the height returned by that drawer. The includeChildren parameter is ignored in that case, as PropertyDrawers always include children.
