EditorGUI 编辑器界面


These work pretty much like the normal GUI functions - and also have matching implementations in EditorGUILayout

非常像普通的GUI函数 - 在EditorGUILayout中也有匹配实现。

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 Variables类变量

  • actionKey
    Is the platform-dependent "action" modifier key held down? (Read Only)
       有平台相关的”action”修改键被按下?(只读)
  • indentLevel
    the indent level of the field labels.
       字段标签的缩进级别。

Class Functions类函数

  • DropShadowLabel
    Draws a label with a drop shadow.
       绘制一个带阴影的标签。
  • 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 floats.
    制作一个文本字段,可以输入浮点值。    
  • 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 and drop objects or by selecting an object using the Object Picker.
       制作一个物体字段。可以指定物体无论是通过拖拽物体或通过物体拾取器选择物体。
  • 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的输入框,用来输入Rect值。
  • 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.
       制作一个左侧带折叠箭头的标签。
  • ProgressBar
    Make a progress bar.
       制作一个进度条。
  • PrefixLabel
    Make a label in front of some control.
       在一些控件的的签名制作一个标签。
  • DrawTextureAlpha
    Draws the alpha channel of a texture within a rectangle.
       在矩形内绘制一个纹理的透明通道。
  • DrawPreviewTexture
    Draws the texture within a rectangle.
       在矩形内绘制纹理。
  • PropertyField
    Make a field for SerializedProperty.
       制作一个SerializedProperty字段。


,