Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

EditorGUILayout.GetControlRect

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual
public static function GetControlRect(params options: GUILayoutOption[]): Rect;
public static Rect GetControlRect(params GUILayoutOption[] options);
public static function GetControlRect(hasLabel: bool, params options: GUILayoutOption[]): Rect;
public static Rect GetControlRect(bool hasLabel, params GUILayoutOption[] options);
public static function GetControlRect(hasLabel: bool, height: float, params options: GUILayoutOption[]): Rect;
public static Rect GetControlRect(bool hasLabel, float height, params GUILayoutOption[] options);
public static function GetControlRect(hasLabel: bool, height: float, style: GUIStyle, params options: GUILayoutOption[]): Rect;
public static Rect GetControlRect(bool hasLabel, float height, GUIStyle style, params GUILayoutOption[] options);

Parámetros

hasLabel Optional boolean to specify if the control has a label. Default is true.
height The height in pixels of the control. Default is EditorGUIUtility.singleLineHeight.
style Optional GUIStyle to use for the control.
options An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style. See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.

Descripción

Get a rect for an Editor control.

When creating a new Editor control it is a sound design to implement the actual control without relying on GUILayout and instead have the control take a Rect as parameter, similar to the controls in the EditorGUI class. This ensures the control can also be used in for example a PropertyDrawer, which does not allow GUILayout.

Once a non-layout version of the control is implemented, a layout version can easily be made as well, which simply calls into the non-layout version. In order to get a rect fitting for the control, the GetControlRect function can be used.