EditorGUI

class in UnityEditor

Switch to Manual

Description

这些方法的运行方式与常规 GUI 函数十分相似,并且在 EditorGUILayout 中也有匹配实现。

Static Variables

actionKey是否按住了平台相关的“action”修改键?(只读)
indentLevel字段标签的缩进级别。
showMixedValue使后续控件呈现出编辑多个不同值的外观。

Static Functions

BeginChangeCheck检查代码块中是否有任何控件被更改。
BeginDisabledGroup创建一组可禁用的控件。
BeginProperty创建一个属性封装器,可用于使常规 GUI 控件与 SerializedProperty 配合使用。
BoundsFieldMakes Center and Extents field for entering a Bounds.
BoundsIntFieldMakes Position and Size field for entering a BoundsInt.
CanCacheInspectorGUI确定能否缓存 SerializedProperty 的检视面板 GUI。
ColorFieldMakes a field for selecting a Color.
CurveField生成一个用于编辑 AnimationCurve 的字段。
DelayedDoubleFieldMakes a delayed text field for entering doubles.
DelayedFloatFieldMakes a delayed text field for entering floats.
DelayedIntFieldMakes a delayed text field for entering integers.
DelayedTextFieldMakes a delayed text field.
DoubleField生成一个用于输入双精度浮点数的文本字段。
DrawPreviewTexture在矩形内绘制纹理。
DrawRect在当前编辑器窗口中的指定位置以指定大小绘制一个着色的矩形。
DrawTextureAlpha在矩形内绘制纹理的 Alpha 通道。
DropdownButtonMakes a button that reacts to mouse down, for displaying your own dropdown content.
DropShadowLabel绘制带有投影的标签。
EndChangeCheck结束由 BeginChangeCheck () 开始的更改检查。
EndDisabledGroup结束由 BeginDisabledGroup 开始的禁用组。
EndProperty结束由 BeginProperty 开始的属性封装器。
EnumFlagsFieldDisplays a menu with an option for every value of the enum type when clicked. An option for the value 0 with name "Nothing" and an option for the value ~0 (that is, all bits set) with the name "Everything" are always displayed at the top of the menu. The names for the values 0 and ~0 can be overriden by defining these values in the enum type.
EnumPopupMakes an enum popup selection field.
FloatFieldMakes a text field for entering floats.
FocusTextInControl将键盘焦点移动到指定的文本字段,并开始编辑内容。
FoldoutMakes a label with a foldout arrow to the left of it.
GetPropertyHeight获取 PropertyField 控件所需的高度。
GradientFieldMakes a field for editing a Gradient.
HandlePrefixLabelMakes a label for some control.
HelpBoxMakes a help box with a message to the user.
InspectorTitlebarMakes an inspector-window-like titlebar.
IntFieldMakes a text field for entering integers.
IntPopupMakes an integer popup selection field.
IntSliderMakes a slider the user can drag to change an integer value between a min and a max.
LabelFieldMakes a label field. (Useful for showing read-only info.)
LayerFieldMakes a layer selection field.
LongFieldMakes a text field for entering long integers.
MaskFieldMakes a field for masks.
MinMaxSliderMakes a special slider the user can use to specify a range between a min and a max.
MultiFloatFieldMakes a multi-control with text fields for entering multiple floats in the same line.
MultiIntFieldMakes a multi-control with text fields for entering multiple integers in the same line.
MultiPropertyFieldMakes a multi-control with several property fields in the same line.
ObjectFieldMakes an object field. You can assign objects either by drag and drop objects or by selecting an object using the Object Picker.
PasswordFieldMakes a text field where the user can enter a password.
PopupMakes a generic popup selection field.
PrefixLabelMakes a label in front of some control.
ProgressBarMakes a progress bar.
PropertyField使用此方法在编辑器中针对 SerializedProperty 创建一个字段。
RectFieldMakes an X, Y, W, and H field for entering a Rect.
RectIntFieldMakes an X, Y, W, and H field for entering a RectInt.
SelectableLabelMakes a selectable label field. (Useful for showing read-only info that can be copy-pasted.)
SliderMakes a slider the user can drag to change a value between a min and a max.
TagFieldMakes a tag selection field.
TextAreaMakes a text area.
TextFieldMakes a text field.
ToggleMakes a toggle.
ToggleLeftMakes a toggle field where the toggle is to the left and the label immediately to the right of it.
Vector2FieldMakes an X and Y field for entering a Vector2.
Vector2IntFieldMakes an X and Y integer field for entering a Vector2Int.
Vector3FieldMakes an X, Y, and Z field for entering a Vector3.
Vector3IntFieldMakes an X, Y, and Z integer field for entering a Vector3Int.
Vector4FieldMakes an X, Y, Z, and W field for entering a Vector4.