EditorGUILayout 编辑器界面布局
Auto-layouted version of EditorGUI
EditorGUI的自动布局版本。
Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.
注意:这是一个编辑器类,如果想使用它你需要把它放到工程目录下的Assets/Editor文件夹下。编辑器类在UnityEditor命名空间下。所以当使用C#脚本时,你需要在脚本前面加上 "using UnityEditor"引用。
Class Functions类函数
- LabelFieldMake a label field. (Useful for showing read-only info.)
制作一个标签字段。(通常用于显示只读信息) - ToggleMake a toggle. // 制作开关按钮。
- TextFieldMake a text field. // 制作一个文本字段。
- TextAreaMake a text area. // 制作一个文本区域。
- SelectableLabelMake a selectable label field. (Useful for showing read-only info that can be copy-pasted.)
制作一个可选择标签字段。(通常用于显示只读信息,可以被复制粘贴) - PasswordFieldMake a text field where the user can enter a password.
创建一个文本字段,在那里用户可以输入密码。 - FloatFieldMake a text field for entering float values.
制作文本字段用于输入浮点值。 - IntFieldMake a text field for entering integers.
制作一个文本字段用于输入整数。 - SliderMake a slider the user can drag to change a value between a min and a max.
制作一个滑动条用户可以拖动来改变值,在最小和最大值之间。 - IntSliderMake a slider the user can drag to change an integer value between a min and a max.
制作一个滑动条用户可以拖动来改变一个整数值,在最小和最大值之间。 - MinMaxSliderMake a special slider the user can use to specify a range between a min and a max.
制作一个特殊滑动条,用户可以使用指定的范围,在最小和最大值之间。 - PopupMake a generic popup selection field.
制作一个标准弹出选择字段。 - EnumPopupMake an enum popup selection field.
制作一个枚举弹出选择字段。 - IntPopupMake an integer popup selection field.
制作一个整数弹出选择字段。 - TagFieldMake a tag selection field.
制作一个标签选择字段。 - LayerFieldMake a layer selection field.
制作一个层选择字段。 - ObjectFieldMake an object field. You can assign objects either by drag'n drop objects or by selecting an object
制作一个物体字段。可以指定物体无论是通过拖拽物体或通过物体拾取器选择物体。 - ObjectFieldMake an object drop slot field.
制作一个物体的拖拽槽字段。 - Vector2FieldMake an X & Y field for entering a Vector2.
制作X & Y字段用于输入Vector2。 - Vector3FieldMake an X, Y & Z field for entering a Vector3.
制作X , Y & Z字段用于输入Vector3。 - Vector4FieldMake an X, Y, Z & W field for entering a Vector4.
制作X, Y, Z & W字段用于输入Vector4。 - RectFieldMake an X, Y, W & H field for entering a Rect.
制作 X, Y, W & H字段用于输入矩形。 - BoundsFieldMake Center & Extents field for entering a Bounds.
制作Center & Extents字段,用于输入一个Bounds。 - ColorFieldMake a field for selecting a Color.
制作一个用于选择颜色的字段。 - CurveFieldMake a field for editing an AnimationCurve.
制作一个用于编辑动画曲线的字段。 - InspectorTitlebarMake an inspector-window-like titlebar.
制作一个检视面板的标题栏。 - FoldoutMake a label with a foldout arrow to the left of it.
制作一个左侧带有箭头的折叠标签。 - PrefixLabelMake a label in front of some control.
制作一个在某些控件前面的标签。 - SpaceMake a small space between the previous control and the following.
在上一个控件和跟随的控件之间,制作一个小的空距。 - BeginToggleGroupBegin a vertical group with a toggle to enable or disable all the controls within at once.
开始带有开关按钮的一个垂直组,在这里立即启用或禁用控件。 - EndToggleGroupClose a group started with BeginToggleGroup
关闭BeginToggleGroup开始的组。 - BeginHorizontalBegin a horizontal group and get its rect back.
开始一个水平组并获取返回矩形。 - EndHorizontalClose a group started with BeginHorizontal
关闭一个BeginHorizontal开始的组。 - BeginVerticalBegin a vertical group and get its rect back.
开始一个垂直组并获取它的返回矩形。 - EndVerticalClose a group started with BeginVertical
结束一个由BeginVertical开始的组。 - BeginScrollViewBegin an automatically layouted scrollview.
开始一个自动布局滚动视图。 - EndScrollViewEnds a scrollview started with a call to BeginScrollView.
结束一个由BeginScrollView开始的滚动视图。 - PropertyFieldMake a field for SerializedProperty.
制作一个用于SerializedProperty的属性字段。