ドキュメント

Unity Engine

Unity Engine

GetPropertyHeight

Get the height needed for a EditorGUI.PropertyField control.
読み終わるまでの所要時間 2 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule

GetPropertyHeight(SerializedPropertyType, GUIContent)

Get the height needed for a EditorGUI.PropertyField control.
public static float GetPropertyHeight(SerializedPropertyType type, GUIContent label)

Parameters


Descriptive text or image.

Returns

Type

Description

float

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 control.
public static float GetPropertyHeight(SerializedProperty property, bool includeChildren)

Parameters

Height of the property area.

includeChildren

Should the returned height include the height of child properties?

Returns

Type

Description

float

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 control.
public static float GetPropertyHeight(SerializedProperty property, GUIContent label, bool includeChildren)

Parameters

Height of the property area.

Descriptive text or image.

includeChildren

Should the returned height include the height of child properties?

Returns

Type

Description

float

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.