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类变量
- actionKeyIs the platform-dependent "action" modifier key held down? (Read Only)
有平台相关的”action”修改键被按下?(只读) - indentLevelthe indent level of the field labels.
字段标签的缩进级别。
Class Functions类函数
- DropShadowLabelDraws a label with a drop shadow.
绘制一个带阴影的标签。 - 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 floats.
制作一个文本字段,可以输入浮点值。 - 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 and drop objects or by selecting an object using the Object Picker.
制作一个物体字段。可以指定物体无论是通过拖拽物体或通过物体拾取器选择物体。 - 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的输入框,用来输入Rect值。 - 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.
制作一个左侧带折叠箭头的标签。 - ProgressBarMake a progress bar.
制作一个进度条。 - PrefixLabelMake a label in front of some control.
在一些控件的的签名制作一个标签。 - DrawTextureAlphaDraws the alpha channel of a texture within a rectangle.
在矩形内绘制一个纹理的透明通道。 - DrawPreviewTextureDraws the texture within a rectangle.
在矩形内绘制纹理。 - PropertyFieldMake a field for SerializedProperty.
制作一个SerializedProperty字段。