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类函数

  • LabelField
    Make a label field. (Useful for showing read-only info.)
       制作一个标签字段。(通常用于显示只读信息)
  • Toggle
    Make a toggle. // 制作开关按钮。
  • TextField
    Make a text field. // 制作一个文本字段。
  • TextArea
    Make a text area. // 制作一个文本区域。
  • SelectableLabel
    Make a selectable label field. (Useful for showing read-only info that can be copy-pasted.)
       制作一个可选择标签字段。(通常用于显示只读信息,可以被复制粘贴)
  • PasswordField
    Make a text field where the user can enter a password.
       创建一个文本字段,在那里用户可以输入密码。
  • FloatField
    Make a text field for entering float values.
       制作文本字段用于输入浮点值。
  • IntField
    Make a text field for entering integers.
       制作一个文本字段用于输入整数。
  • Slider
    Make a slider the user can drag to change a value between a min and a max.
       制作一个滑动条用户可以拖动来改变值,在最小和最大值之间。
  • IntSlider
    Make a slider the user can drag to change an integer value between a min and a max.
       制作一个滑动条用户可以拖动来改变一个整数值,在最小和最大值之间。
  • MinMaxSlider
    Make a special slider the user can use to specify a range between a min and a max.
       制作一个特殊滑动条,用户可以使用指定的范围,在最小和最大值之间。
  • Popup
    Make a generic popup selection field.
       制作一个标准弹出选择字段。
  • EnumPopup
    Make an enum popup selection field.
       制作一个枚举弹出选择字段。
  • IntPopup
    Make an integer popup selection field.
       制作一个整数弹出选择字段。
  • TagField
    Make a tag selection field.
       制作一个标签选择字段。
  • LayerField
    Make a layer selection field.
       制作一个层选择字段。
  • ObjectField
    Make an object field. You can assign objects either by drag'n drop objects or by selecting an object
       制作一个物体字段。可以指定物体无论是通过拖拽物体或通过物体拾取器选择物体。
  • ObjectField
    Make an object drop slot field.
       制作一个物体的拖拽槽字段。
  • Vector2Field
    Make an X & Y field for entering a Vector2.
       制作X & Y字段用于输入Vector2。
  • Vector3Field
    Make an X, Y & Z field for entering a Vector3.
       制作X , Y & Z字段用于输入Vector3。
  • Vector4Field
    Make an X, Y, Z & W field for entering a Vector4.
       制作X, Y, Z & W字段用于输入Vector4。
  • RectField
    Make an X, Y, W & H field for entering a Rect.
       制作 X, Y, W & H字段用于输入矩形。
  • BoundsField
    Make Center & Extents field for entering a Bounds.
       制作Center & Extents字段,用于输入一个Bounds。
  • ColorField
    Make a field for selecting a Color.
       制作一个用于选择颜色的字段。
  • CurveField
    Make a field for editing an AnimationCurve.
       制作一个用于编辑动画曲线的字段。
  • InspectorTitlebar
    Make an inspector-window-like titlebar.
       制作一个检视面板的标题栏。
  • Foldout
    Make a label with a foldout arrow to the left of it.
       制作一个左侧带有箭头的折叠标签。
  • PrefixLabel
    Make a label in front of some control.
       制作一个在某些控件前面的标签。
  • Space
    Make a small space between the previous control and the following.
       在上一个控件和跟随的控件之间,制作一个小的空距。
  • BeginToggleGroup
    Begin a vertical group with a toggle to enable or disable all the controls within at once.
       开始带有开关按钮的一个垂直组,在这里立即启用或禁用控件。
  • EndToggleGroup
    Close a group started with BeginToggleGroup
    关闭BeginToggleGroup开始的组。
  • BeginHorizontal
    Begin a horizontal group and get its rect back.
       开始一个水平组并获取返回矩形。
  • EndHorizontal
    Close a group started with BeginHorizontal
       关闭一个BeginHorizontal开始的组。
  • BeginVertical
    Begin a vertical group and get its rect back.
       开始一个垂直组并获取它的返回矩形。
  • EndVertical
    Close a group started with BeginVertical
       结束一个由BeginVertical开始的组。
  • BeginScrollView
    Begin an automatically layouted scrollview.
       开始一个自动布局滚动视图。
  • EndScrollView
    Ends a scrollview started with a call to BeginScrollView.
       结束一个由BeginScrollView开始的滚动视图。
  • PropertyField
    Make a field for SerializedProperty.
       制作一个用于SerializedProperty的属性字段。


,