这些方法的运行方式与常规 GUI 函数十分相似,并且在 EditorGUILayout 中也有匹配实现。
actionKey | 是否按住了平台相关的“action”修改键?(只读) |
indentLevel | 字段标签的缩进级别。 |
showMixedValue | 使后续控件呈现出编辑多个不同值的外观。 |
BeginChangeCheck | 启动一个新代码块来检查 GUI 更改。 |
BeginDisabledGroup | 创建一组可禁用的控件。 |
BeginFoldoutHeaderGroup | 创建一个左侧带有折叠箭头的标签。 |
BeginProperty | 创建一个属性封装器,可用于使常规 GUI 控件与 SerializedProperty 配合使用。 |
BoundsField | 创建用于输入 Bounds 的 Center 和 Extents 字段。 |
BoundsIntField | 创建用于输入 BoundsInt 的 Position 和 Size 字段。 |
CanCacheInspectorGUI | 确定能否缓存 SerializedProperty 的检视面板 GUI。 |
ColorField | 创建一个用于选择 Color 的字段。 |
CurveField | 生成一个用于编辑 AnimationCurve 的字段。 |
DelayedDoubleField | 创建一个用于输入双精度浮点数的延迟文本字段。 |
DelayedFloatField | 创建一个用于输入浮点数的延迟文本字段。 |
DelayedIntField | 创建一个用于输入整数的延迟文本字段。 |
DelayedTextField | 创建一个延迟文本字段。 |
DoubleField | 生成一个用于输入双精度浮点数的文本字段。 |
DrawPreviewTexture | 在矩形内绘制纹理。 |
DrawRect | 在当前编辑器窗口中的指定位置以指定大小绘制一个着色的矩形。 |
DrawTextureAlpha | 在矩形内绘制纹理的 Alpha 通道。 |
DropdownButton | 创建一个能够对鼠标按下做出反应的按钮,用于显示您自己的下拉菜单内容。 |
DropShadowLabel | 绘制带有投影的标签。 |
EndChangeCheck | 结束代码块并检查是否有任何 GUI 更改。 |
EndDisabledGroup | 结束由 BeginDisabledGroup 开始的禁用组。 |
EndFoldoutHeaderGroup | 关闭以 BeginFoldoutHeaderGroup 开头的组。 另请参阅:EditorGUILayout.BeginFoldoutHeaderGroup。 |
EndProperty | 结束由 BeginProperty 开始的属性封装器。 |
EnumFlagsField | Displays 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. |
EnumPopup | 创建一个枚举弹出选择字段。 |
FloatField | 创建一个用于输入浮点数的文本字段。 |
FocusTextInControl | 将键盘焦点移动到指定的文本字段,并开始编辑内容。 |
Foldout | 创建一个左侧带有折叠箭头的标签。 |
GetPropertyHeight | 获取 PropertyField 控件所需的高度。 |
GradientField | 创建一个用于编辑 Gradient 的字段。 |
HandlePrefixLabel | 为一些控件创建一个标签。 |
HelpBox | 创建一个带有发送给用户的消息的帮助框。 |
InspectorTitlebar | 创建一个类似于 Inspector 窗口的标题栏。 |
IntField | 创建一个用于输入整数的文本字段。 |
IntPopup | 创建一个整数弹出选择字段。 |
IntSlider | 创建一个滑动条,用户可以进行拖动以在最小值和最大值之间更改整数值。 |
LabelField | 创建一个标签字段。(用于显示只读信息。) |
LayerField | 创建一个层选择字段。 |
LinkButton | Make a clickable link label. |
LongField | 创建一个用于输入长整数的文本字段。 |
MaskField | 创建一个适用于掩码的字段。 |
MinMaxSlider | 创建一个特殊滑动条,用户可利用该滑动条指定最小值和最大值之间的一个范围。 |
MultiFloatField | 创建一个带有文本字段的多控件,用于在同一行中输入多个浮点值。 |
MultiIntField | 创建一个带有文本字段的多控件,用于在同一行中输入多个整数。 |
MultiPropertyField | 创建一个在同一行中包含多个属性字段的多控件。 |
ObjectField | 创建一个对象字段。您可以通过拖放对象或使用对象选择器选择对象来分配对象。 |
PasswordField | 创建一个可让用户输入密码的文本字段。 |
Popup | 创建一个通用弹出选择字段。 |
PrefixLabel | 创建一个显示在特定控件前的标签。 |
ProgressBar | 创建一个进度条。 |
PropertyField | 使用此方法在编辑器中针对 SerializedProperty 创建一个字段。 |
RectField | 创建用于输入 Rect 的 X、Y、W 和 H 字段。 |
RectIntField | 创建用于输入 RectInt 的 X、Y、W 和 H 字段。 |
SelectableLabel | 创建一个可选择标签字段。(用于显示可复制粘贴的只读信息。) |
Slider | 创建一个滑动条,用户可以进行拖动以在最小值和最大值之间更改值。 |
TagField | 创建一个标签选择字段。 |
TextArea | 创建一个文本区域。 |
TextField | 创建一个文本字段。 |
Toggle | 创建一个开关。 |
ToggleLeft | 创建一个开关字段,其中开关位于左侧,标签紧随其右。 |
Vector2Field | 创建用于输入 Vector2 的 X 和 Y 字段。 |
Vector2IntField | 创建用于输入 Vector2Int 的 X 和 Y 整数字段。 |
Vector3Field | 创建用于输入 Vector3 的 X、Y 和 Z 字段。 |
Vector3IntField | 创建用于输入 Vector3Int 的 X、Y 和 Z 整数字段。 |
Vector4Field | 创建用于输入 Vector4 的 X、Y、Z 和 W 字段。 |
hyperLinkClicked | Event used to react on clicks on a text hyperlink part. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.