Unity API通读 EditorGUILayout

EditorGUILayout

自动布局的EditorGUI版本
UnityEditor类 实现接口UnityEditor

·静态方法
BeginFadeGroup
开始一个可以隐藏/显示的组 并将通过动画转换
方法
public static bool BeginFadeGroup(float value);
参数
value 一个介于0和1之间的值 0为隐藏 1为全部可见
返回结果
bool 组是否可见
BeginHorizonta
开始一个水平的组 并将其rect返回
方法
public static Rect BeginHorizontal(GUIStyle style, params GUILayoutOption[] options);
public static Rect BeginHorizontal(params GUILayoutOption[] options);
参数
style 可选的GUIStyle
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Rect 脚本位于检查器中的矩阵数据
BeginScrollView
开始一个自动布局的滚动视图
方法
public static Vector2 BeginScrollView(Vector2 scrollPosition, params GUILayoutOption[] options);
public static Vector2 BeginScrollView(Vector2 scrollPosition, bool alwaysShowHorizontal, bool alwaysShowVertical, params GUILayoutOption[] options);
public static Vector2 BeginScrollView(Vector2 scrollPosition, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar, params GUILayoutOption[] options);
public static Vector2 BeginScrollView(Vector2 scrollPosition, bool alwaysShowHorizontal, bool alwaysShowVertical, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar, GUIStyle background, params GUILayoutOption[] options);
参数
scrollPosition 用来显示的位置
alwayShowHorizontal 用于始终显示水平滚动条的可选参数 如果为false或忽略 则仅当滚动视图中的内容宽于滚动视图本身才显示
alwayShowVertical 用于始终显示垂直滚动条的可选参数 如果为false或忽略 则仅当滚动视图中的内容高于滚动视图本身才显示
horizontalScrollbar 用于水平滚动条的可选GUIStyle 如果为忽略 则使用当前GUISkin的水平滚动条样式
verticalScrollbar 用于垂直滚动条的可选GUIStyle 如果为忽略 则使用当前GUISkin的垂直滚动条样式
返回结果
Vector2 修改后的滚动位置
BeginToggleGroup
开始带有一个切换键的垂直组 可以一起开启或禁用所有的控件
方法
public static bool BeginToggleGroup(string label, bool toggle);
public static bool BeginToggleGroup(GUIContent label, bool toggle);
参数
label 显示在切换控件上方的标签
toggle 切换组的启用状态
返回结果
bool 用户选择的启用状态
BeginVertical
开始一个垂直的组 并将其rect返回
方法
public static Rect BeginVertical(params GUILayoutOption[] options);
public static Rect BeginVertical(GUIStyle style, params GUILayoutOption[] options);
参数
style 可选的GUIStyle
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Rect 脚本位于检查器中的矩阵数据
BoundsField
创建一个用于输入Bounds[-]的中心和范围的字段
方法
public static Bounds BoundsField(Bounds value, params GUILayoutOption[] options);
public static Bounds BoundsField(string label, Bounds value, params GUILayoutOption[] options);
public static Bounds BoundsField(GUIContent label, Bounds value, params GUILayoutOption[] options);
参数
label 显示在字段前的标签
value 用于编辑的值
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Bounds 用户输入的值
BoundsIntField
创建一个用于输入BoundsInt[-]的位置和大小的字段
方法
public static BoundsInt BoundsIntField(BoundsInt value, params GUILayoutOption[] options);
public static BoundsInt BoundsIntField(string label, BoundsInt value, params GUILayoutOption[] options);
public static BoundsInt BoundsIntField(GUIContent label, BoundsInt value, params GUILayoutOption[] options);
参数
label 显示在字段前的标签
value 用于编辑的值
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
BoundsInt 用户输入的值
ColorField
创建一个用于选择颜色的字段
方法
public static Color ColorField(Color value, params GUILayoutOption[] options);
public static Color ColorField(string label, Color value, params GUILayoutOption[] options);
public static Color ColorField(GUIContent[-] label, Color value, params GUILayoutOption[] options);
public static Color ColorField(GUIContent[-] label, Color value, bool showEyedropper, bool showAlpha, bool hdr, params GUILayoutOption[] options);
public static Color ColorField(GUIContent[-] label, Color value, bool showEyedropper, bool showAlpha, bool hdr, ColorPickerHDRConfig hdrConfig, params GUILayoutOption[] options); [废弃]
参数
label 显示在字段前的可选标签
value 用于编辑的值
showEyedropper 如果为true 颜色选择器显示滴管控件 如果为false 不显示
showAlpha 如果为true 允许用户为颜色设置alpha值 如果为false 隐藏alpha组件
hdr 如果为true 讲颜色视为HDR值 如果为false 讲其视为标准LDR值
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Color 用户选中的值
CurveField
创建编辑动画曲线的字段
方法
public static AnimationCurve CurveField(AnimationCurve value, params GUILayoutOption[] options);
public static AnimationCurve CurveField(string label, AnimationCurve value, params GUILayoutOption[] options);
public static AnimationCurve CurveField(GUIContent label, AnimationCurve value, params GUILayoutOption[] options);
public static AnimationCurve CurveField(AnimationCurve value, Color color, Rect ranges, params GUILayoutOption[] options);
public static AnimationCurve CurveField(string label, AnimationCurve value, Color color, Rect ranges, params GUILayoutOption[] options);
public static AnimationCurve CurveField(GUIContent label, AnimationCurve value, Color color, Rect ranges, params GUILayoutOption[] options);
参数
label 显示在字段前的可选标签
value 用于编辑的曲线
color 用于显示曲线的颜色
ranges 约束曲线的可选矩形
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
AnimationCurve 用户编辑的曲线
方法
public static void CurveField(SerializedProperty property, Color color, Rect ranges, params GUILayoutOption[] options);
public static void CurveField(SerializedProperty property, Color color, Rect ranges, GUIContent label, params GUILayoutOption[] options);
参数
property 用于编辑的曲线
color 用于显示曲线的颜色
ranges 约束曲线的可选矩形
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
label 显示在字段前的可选标签 通过[GUIContent.none]隐藏标签
DelayedDoubleField
创建一个用于输入double的延迟文本字段
方法
public static double DelayedDoubleField(double value, params GUILayoutOption[] options);
public static double DelayedDoubleField(double value, GUIStyle style, params GUILayoutOption[] options);
public static double DelayedDoubleField(string label, double value, params GUILayoutOption[] options);
public static double DelayedDoubleField(string label, double value, GUIStyle style, params GUILayoutOption[] options);
public static double DelayedDoubleField(GUIContent label, double value, params GUILayoutOption[] options);
public static double DelayedDoubleField(GUIContent label, double value, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在double字段前的可选标签
value 用于编辑的值
style 可选的GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
double 用户输入的值 注意在用户按下Enter或焦点从double字段移开前是不会改变的 也就是所谓的延迟
DelayedFloatField
创建一个用于输入float的延迟文本字段
方法
public static float DelayedFloatField(float value, params GUILayoutOption[] options);
public static float DelayedFloatField(float value, GUIStyle style, params GUILayoutOption[] options);
public static float DelayedFloatField(string label, float value, params GUILayoutOption[] options);
public static float DelayedFloatField(string label, float value, GUIStyle style, params GUILayoutOption[] options);
public static float DelayedFloatField(GUIContent label, float value, params GUILayoutOption[] options);
public static float DelayedFloatField(GUIContent label, float value, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在float字段前的可选标签
value 用于编辑的值
style 可选的GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
float 用户输入的值 注意在用户按下Enter或焦点从float字段移开前是不会改变的 也就是所谓的延迟
方法
public static void DelayedFloatField(SerializedProperty property, GUIContent label, params GUILayoutOption[] options);
public static void DelayedFloatField(SerializedProperty property, params GUILayoutOption[] options);
参数
property 用于编辑的float属性
label 显示在字段前的可选标签 通过[GUIContent.none]隐藏标签
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
DelayedIntField
创建一个用于输入int的延迟文本字段
方法
public static int DelayedIntField(int value, params GUILayoutOption[] options);
public static int DelayedIntField(int value, GUIStyle style, params GUILayoutOption[] options);
public static int DelayedIntField(string label, int value, params GUILayoutOption[] options);
public static int DelayedIntField(string label, int value, GUIStyle style, params GUILayoutOption[] options);
public static int DelayedIntField(GUIContent label, int value, params GUILayoutOption[] options);
public static int DelayedIntField(GUIContent label, int value, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在double字段前的可选标签
value 用于编辑的值
style 可选的GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
int 用户输入的值 注意在用户按下Enter或焦点从int字段移开前是不会改变的 也就是所谓的延迟
方法
public static void DelayedIntField(SerializedProperty property, params GUILayoutOption[] options);
public static void DelayedIntField(SerializedProperty property, GUIContent label, params GUILayoutOption[] options);
参数
property 用于编辑的int属性
label 显示在字段前的可选标签 通过[GUIContent.none]隐藏标签
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
DelayedTextField
创建一个延迟文本字段
方法
public static string DelayedTextField(string text, params GUILayoutOption[] options);
public static string DelayedTextField(string text, GUIStyle style, params GUILayoutOption[] options);
public static string DelayedTextField(string label, string text, params GUILayoutOption[] options);
public static string DelayedTextField(string label, string text, GUIStyle style, params GUILayoutOption[] options);
public static string DelayedTextField(GUIContent label, string text, params GUILayoutOption[] options);
public static string DelayedTextField(GUIContent label, string text, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在文本字段前的可选标签
value 用于编辑的值
style 可选的GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
string 用户输入的值 注意在用户按下Enter或焦点从文本字段移开前是不会改变的 也就是所谓的延迟
方法
public static void DelayedTextField(SerializedProperty property, params GUILayoutOption[] options);
public static void DelayedTextField(SerializedProperty property, GUIContent label, params GUILayoutOption[] options);
参数
property 用于编辑的文本属性
label 显示在字段前的可选标签 通过[GUIContent.none]隐藏标签
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
DelayedTextField
DoubleField
创建一个用于输入double值的文本字段
方法
public static double DoubleField(double value, params GUILayoutOption[] options);
public static double DoubleField(double value, GUIStyle style, params GUILayoutOption[] options);
public static double DoubleField(string label, double value, params GUILayoutOption[] options);
public static double DoubleField(string label, double value, GUIStyle style, params GUILayoutOption[] options);
public static double DoubleField(GUIContent label, double value, params GUILayoutOption[] options);
public static double DoubleField(GUIContent label, double value, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在double字段前的可选标签
value 用于编辑的值
style 可选的GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
double 用户输入的值
DropdownButton
创建一个对鼠标按下做出反应而显示自己的下拉内容的按钮
方法
public static bool DropdownButton(GUIContent content, FocusType focusType, params GUILayoutOption[] options);
public static bool DropdownButton(GUIContent content, FocusType focusType, GUIStyle style, params GUILayoutOption[] options);
参数
content 此按钮的文本 图像和提示
focusType 按钮是否可以通过键盘选择
style 可选的GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
EndFadeGroup
结束一个以BeginFadeGroup开始的组
方法
public static void EndFadeGroup();
EndHorizontal
结束一个以BeginHorizontal开始的组
方法
public static void EndHorizontal();
EndScrollView
结束一个自动布局的滚动视图
方法
public static void EndScrollView();
EndToggleGroup
结束一个以BeginToggleGroup开始的组
方法
public static void EndToggleGroup();
EndVertical
结束一个以BeginVertical开始的组
方法
public static void EndVertical();
EnumFlagsField
点击时显示一个菜单 其中包含枚举类型的每个值的选项
方法
public static Enum EnumFlagsField(Enum enumValue, params GUILayoutOption[] options);
public static Enum EnumFlagsField(Enum enumValue, GUIStyle style, params GUILayoutOption[] options);
public static Enum EnumFlagsField(string label, Enum enumValue, params GUILayoutOption[] options);
public static Enum EnumFlagsField(string label, Enum enumValue, GUIStyle style, params GUILayoutOption[] options);
public static Enum EnumFlagsField(GUIContent label, Enum enumValue, params GUILayoutOption[] options);
public static Enum EnumFlagsField(GUIContent label, Enum enumValue, GUIStyle style, params GUILayoutOption[] options);
public static Enum EnumFlagsField(GUIContent label, Enum enumValue, bool includeObsolete, params GUILayoutOption[] options);
public static Enum EnumFlagsField(GUIContent label, Enum enumValue, bool includeObsolete, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在枚举标志字段前的可选标签
enumValue 枚举标志值
style 可选的GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
includeObsolete 设置为true以包括具有ObsoleteAttribute的枚举值 设置为false以排除具有ObsoleteAttribute的枚举值
返回结果
Enum 用户修改的枚举标志值 这是个选择位掩码 其中每个位表示枚举值索引 注意此返回值本身不是枚举
EnumPopup
创建一个枚举弹出选择字段
方法
public static Enum EnumPopup(Enum selected, params GUILayoutOption[] options);
public static Enum EnumPopup(Enum selected, GUIStyle style, params GUILayoutOption[] options);
public static Enum EnumPopup(string label, Enum selected, params GUILayoutOption[] options);
public static Enum EnumPopup(string label, Enum selected, GUIStyle style, params GUILayoutOption[] options);
public static Enum EnumPopup(GUIContent label, Enum selected, params GUILayoutOption[] options);
public static Enum EnumPopup(GUIContent label, Enum selected, GUIStyle style, params GUILayoutOption[] options);
public static Enum EnumPopup(GUIContent label, Enum selected, Func<Enum,bool> checkEnabled, bool includeObsolete, params GUILayoutOption[] options);
public static Enum EnumPopup(GUIContent label, Enum selected, Func<Enum,bool> checkEnabled, bool includeObsolete, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在字段前的可选标签
selected 字段显示的枚举选项
style 可选的GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
includeObsolete 设置为true以包括具有ObsoleteAttribute的枚举值 设置为false以排除具有ObsoleteAttribute的枚举值
checkEnabled 为显示的每个枚举值调用了方法 如果可以选择该选项 则指定的方法应返回true 否则返回false
返回结果
Enum 用户选择的枚举选项
FloatField
为输入float创建一个文本字段
方法
public static float FloatField(float value, params GUILayoutOption[] options);
public static float FloatField(float value, GUIStyle style, params GUILayoutOption[] options);
public static float FloatField(string label, float value, params GUILayoutOption[] options);
public static float FloatField(string label, float value, GUIStyle style, params GUILayoutOption[] options);
public static float FloatField(GUIContent label, float value, params GUILayoutOption[] options);
public static float FloatField(GUIContent label, float value, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在字段前的可选标签
value 编辑的值
style 可选的GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
float 用户输入的值
Foldout
创建一个标签 左侧有一个折叠箭头
方法
public static bool Foldout(bool foldout, string content, bool toggleOnLabelClick, GUIStyle style = EditorStyles.foldout);
public static bool Foldout(bool foldout, GUIContent content, bool toggleOnLabelClick, GUIStyle style = EditorStyles.foldout);
public static bool Foldout(bool foldout, string content, GUIStyle style = EditorStyles.foldout);
public static bool Foldout(bool foldout, GUIContent content, GUIStyle style = EditorStyles.foldout);
参数
foldout 显示的折叠状态
content 显示的标签
style 可选的GUIStyle[-]
toggleOnLabelClick 点击标签时是否切换折叠状态
返回结果
bool 用户选择的折叠状态 如果为true则应渲染子对象
GetControlRect
获得编辑器控件的Rect
方法
public static Rect GetControlRect(params GUILayoutOption[] options);
public static Rect GetControlRect(bool hasLabel, params GUILayoutOption[] options);
public static Rect GetControlRect(bool hasLabel, float height, params GUILayoutOption[] options);
public static Rect GetControlRect(bool hasLabel, float height, GUIStyle style, params GUILayoutOption[] options);
参数
hasLabel 指定控件是否具有标签的bool值 默认为true
height 控件的以像素为单位的高度 默认为EditorGUIUtility.singleLineHeight
style 用于控件的可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Rect 编辑器控件的Rect
GradientField
创建一个用于编辑渐变的字段
方法
public static Gradient GradientField(Gradient value, params GUILayoutOption[] options);
public static Gradient GradientField(string label, Gradient value, params GUILayoutOption[] options);
public static Gradient GradientField(GUIContent label, Gradient value, params GUILayoutOption[] options);
public static Gradient GradientField(GUIContent label, Gradient value, bool hdr, params GUILayoutOption[] options);
参数
label 显示在字段前的可选标签
value 用于编辑的渐变
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Gradient 用户编辑的渐变
HelpBox
创建一个帮助框冰箱用户发送一条消息
方法
public static void HelpBox(string message, MessageType type);
public static void HelpBox(string message, MessageType type, bool wide);
参数
message 消息文本
type 消息类型
wide 如果为true则框讲覆盖窗口的整个宽度 否则将仅覆盖控件部分
InspectorTitlebar
创建一个检查框类的标题栏
方法
public static bool InspectorTitlebar(bool foldout, Object targetObj);
public static bool InspectorTitlebar(bool foldout, Object[] targetObjs);
参数
foldout 箭头所示的折叠状态
targetObj 标题栏用于的对象或多个对象
IntField
创建一个舒服证书的文本字段
方法
public static int IntField(int value, params GUILayoutOption[] options);
public static int IntField(int value, GUIStyle style, params GUILayoutOption[] options);
public static int IntField(string label, int value, params GUILayoutOption[] options);
public static int IntField(string label, int value, GUIStyle style, params GUILayoutOption[] options);
public static int IntField(GUIContent label, int value, params GUILayoutOption[] options);
public static int IntField(GUIContent label, int value, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在字段前的可选标签
value 用于编辑的渐变
style 可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
int 用户输入的值
IntPopup
创建一个整数弹出式选择字段
方法
public static int IntPopup(int selectedValue, string[] displayedOptions, int[] optionValues, params GUILayoutOption[] options);
public static int IntPopup(int selectedValue, string[] displayedOptions, int[] optionValues, GUIStyle style, params GUILayoutOption[] options);
public static int IntPopup(int selectedValue, GUIContent[] displayedOptions, int[] optionValues, params GUILayoutOption[] options);
public static int IntPopup(int selectedValue, GUIContent[] displayedOptions, int[] optionValues, GUIStyle style, params GUILayoutOption[] options);
public static int IntPopup(string label, int selectedValue, string[] displayedOptions, int[] optionValues, params GUILayoutOption[] options);
public static int IntPopup(string label, int selectedValue, string[] displayedOptions, int[] optionValues, GUIStyle style, params GUILayoutOption[] options);
public static int IntPopup(GUIContent label, int selectedValue, GUIContent[] displayedOptions, int[] optionValues, params GUILayoutOption[] options);
public static int IntPopup(GUIContent label, int selectedValue, GUIContent[] displayedOptions, int[] optionValues, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在字段前的可选标签
selectedValue 字段显示的选项的值
displayedOptions 具有用户可以选择的显示选项的数组
optionValues 一个包含每个现象的值的数组
style 可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
int 用户选择的选项的值
IntSlider
创建一个用户可以拖动的滑块 以在最小值和最大值之间改变整数值
方法
public static int IntSlider(int value, int leftValue, int rightValue, params GUILayoutOption[] options);
public static int IntSlider(string label, int value, int leftValue, int rightValue, params GUILayoutOption[] options);
public static int IntSlider(GUIContent label, int value, int leftValue, int rightValue, params GUILayoutOption[] options);
参数
label 显示在滑块前的可选标签
value 滑块显示的值 决定了可拖动块的位置
leftValue 滑块左端的值
rightValue 滑块右端的值
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
int 用户设定的值
LabelField
创建一个标签字段 用于显示只读信息
方法
public static void LabelField(string label, params GUILayoutOption[] options);
public static void LabelField(string label, GUIStyle style, params GUILayoutOption[] options);
public static void LabelField(GUIContent label, params GUILayoutOption[] options);
public static void LabelField(GUIContent label, GUIStyle style, params GUILayoutOption[] options);
public static void LabelField(string label, string label2, params GUILayoutOption[] options);
public static void LabelField(string label, string label2, GUIStyle style, params GUILayoutOption[] options);
public static void LabelField(GUIContent label, GUIContent label2, params GUILayoutOption[] options);
public static void LabelField(GUIContent label, GUIContent label2, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在标签前的标签
label2 显示在右侧的标签
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
LayerField
创建一个层选择字段
方法
public static int LayerField(int layer, params GUILayoutOption[] options);
public static int LayerField(int layer, GUIStyle style, params GUILayoutOption[] options);
public static int LayerField(string label, int layer, params GUILayoutOption[] options);
public static int LayerField(string label, int layer, GUIStyle style, params GUILayoutOption[] options);
public static int LayerField(GUIContent label, int layer, params GUILayoutOption[] options);
public static int LayerField(GUIContent label, int layer, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在字段前的可选标签.
layer 字段中显示的层
style 可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
int 用户选择的层
LongField
创建一个输入长整数的文本字段
方法
public static long LongField(long value, params GUILayoutOption[] options);
public static long LongField(long value, GUIStyle style, params GUILayoutOption[] options);
public static long LongField(string label, long value, params GUILayoutOption[] options);
public static long LongField(string label, long value, GUIStyle style, params GUILayoutOption[] options);
public static long LongField(GUIContent label, long value, params GUILayoutOption[] options);
public static long LongField(GUIContent label, long value, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在字段前的可选标签.
value 用于编辑的值
style 可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
long 用户输入的值
MaskField
创建一个遮罩的字段
方法
public static int MaskField(GUIContent label, int mask, string[] displayedOptions, GUIStyle style, params GUILayoutOption[] options);
public static int MaskField(string label, int mask, string[] displayedOptions, GUIStyle style, params GUILayoutOption[] options);
public static int MaskField(GUIContent label, int mask, string[] displayedOptions, params GUILayoutOption[] options);
public static int MaskField(string label, int mask, string[] displayedOptions, params GUILayoutOption[] options);
public static int MaskField(int mask, string[] displayedOptions, GUIStyle style, params GUILayoutOption[] options);
public static int MaskField(int mask, string[] displayedOptions, params GUILayoutOption[] options);
Parameters
参数
label 字段的前缀标签
mask 显示的当前的遮罩
displayedOption 一个包含每个标志的标签的字符串数组
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
int 用户修改的值
MinMaxSlider
创建一个特殊的滑块 用户可以用它来指定最小值和最大值之间的范围
方法
public static void MinMaxSlider(ref float minValue, ref float maxValue, float minLimit, float maxLimit, params GUILayoutOption[] options);
public static void MinMaxSlider(string label, ref float minValue, ref float maxValue, float minLimit, float maxLimit, params GUILayoutOption[] options);
public static void MinMaxSlider(GUIContent label, ref float minValue, ref float maxValue, float minLimit, float maxLimit, params GUILayoutOption[] options);
参数
label 显示在滑块前的可选标签.
minValue 滑块显示范围的下限值 通过引用传递
maxValue 滑块显示范围的上限值 通过引用传递
minLimit 滑块左侧的限制值
maxLimit 滑块右侧的限制值
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
ObjectField
创建一个接受任何对象类型的字段
方法
public static Object ObjectField(Object obj, Type objType, bool allowSceneObjects, params GUILayoutOption[] options);
public static Object ObjectField(string label, Object obj, Type objType, bool allowSceneObjects, params GUILayoutOption[] options);
public static Object ObjectField(GUIContent label, Object obj, Type objType, bool allowSceneObjects, params GUILayoutOption[] options);
Parameters
参数
label 显示在字段前的可选标签.
obj 字段显示的对象
objType 可以指定的对象的类型
allowSceneObjects 允许分配场景对象
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Object 用户设定的对象
PasswordField
创建一个用户可以输入密码的文本字段
方法
public static string PasswordField(string password, params GUILayoutOption[] options);
public static string PasswordField(string password, GUIStyle style, params GUILayoutOption[] options);
public static string PasswordField(string label, string password, params GUILayoutOption[] options);
public static string PasswordField(string label, string password, GUIStyle style, params GUILayoutOption[] options);
public static string PasswordField(GUIContent label, string password, params GUILayoutOption[] options);
public static string PasswordField(GUIContent label, string password, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在密码字段前的可选标签.
password 编辑的密码
style 可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
string 用户输入的密码
Popup
创建一个通用的弹出式选择字段
方法
public static int Popup(int selectedIndex, string[] displayedOptions, params GUILayoutOption[] options);
public static int Popup(int selectedIndex, string[] displayedOptions, GUIStyle style, params GUILayoutOption[] options);
public static int Popup(int selectedIndex, GUIContent[] displayedOptions, params GUILayoutOption[] options);
public static int Popup(int selectedIndex, GUIContent[] displayedOptions, GUIStyle style, params GUILayoutOption[] options);
public static int Popup(string label, int selectedIndex, string[] displayedOptions, params GUILayoutOption[] options);
public static int Popup(string label, int selectedIndex, string[] displayedOptions, GUIStyle style, params GUILayoutOption[] options);
public static int Popup(GUIContent label, int selectedIndex, GUIContent[] displayedOptions, params GUILayoutOption[] options);
public static int Popup(GUIContent label, int selectedIndex, GUIContent[] displayedOptions, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在字段前的可选标签.
selectedIndex 字段显示的选项的索引
displayedOptions 一个在弹出窗口中显示的选项的数组
style 可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
int 用户选择的选项的索引
PrefixLabel
创建一个在一些空间钱的标签
方法
public static void PrefixLabel(string label, GUIStyle followingStyle = “Button”);
public static void PrefixLabel(string label, GUIStyle followingStyle, GUIStyle labelStyle);
public static void PrefixLabel(GUIContent label, GUIStyle followingStyle = “Button”);
public static void PrefixLabel(GUIContent label, GUIStyle followingStyle, GUIStyle labelStyle);
参数
label 显示在空间左侧的标签
PropertyField
创建一个序列化属性的标签
方法
public static bool PropertyField(SerializedProperty property, params GUILayoutOption[] options);
public static bool PropertyField(SerializedProperty property, GUIContent label, params GUILayoutOption[] options);
public static bool PropertyField(SerializedProperty property, bool includeChildren, params GUILayoutOption[] options);
public static bool PropertyField(SerializedProperty property, GUIContent label, bool includeChildren, params GUILayoutOption[] options);
参数
property 为其生成字段的序列化属性
label 要使用的可选标签 如果未指定则使用属性本身的标签 使用GUIContent.none则不显示标签
includeChildren 如果为true则将绘制包括子级的属性 否则进绘制控件本身
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
bool 如果属性有子级且已展开且includeChildren为false则为true 否则为false
RectField
创建一个用于输入Rect的x y w h的字段
方法
public static Rect RectField(Rect value, params GUILayoutOption[] options);
public static Rect RectField(string label, Rect value, params GUILayoutOption[] options);
public static Rect RectField(GUIContent label, Rect value, params GUILayoutOption[] options);
参数
label 显示在字段上方的标签
value 编辑的值
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Rect 用户输入的值
RectIntField
创建一个用于输入RectInt的x y w h的字段
方法
public static RectInt RectIntField(RectInt value, params GUILayoutOption[] options);
public static RectInt RectIntField(string label, RectInt value, params GUILayoutOption[] options);
public static RectInt RectIntField(GUIContent label, RectInt value, params GUILayoutOption[] options);
参数
label 显示在字段上方的标签
value 编辑的值
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
RectInt 用户输入的值
SelectableLabel
创建一个可选择的标签字段 用于显示可复制粘贴的只读信息
方法
public static void SelectableLabel(string text, params GUILayoutOption[] options);
public static void SelectableLabel(string text, GUIStyle style, params GUILayoutOption[] options);
参数
text 显示的文本
style 可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
Slider
创建一个用户可以拖动的滑块 以在最小值和最大值之间更改值
方法
public static float Slider(float value, float leftValue, float rightValue, params GUILayoutOption[] options);
public static float Slider(string label, float value, float leftValue, float rightValue, params GUILayoutOption[] options);
public static float Slider(GUIContent label, float value, float leftValue, float rightValue, params GUILayoutOption[] options);
参数
label 显示在滑块前的可选标签
value 滑块显示的值 决定了可拖动的位置
leftValue 滑块左侧的值
rightValue 滑块右侧的值
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
float 用户选择的值
Space
在上下两个中间之间流出一个小空行
方法
public static void Space();
TagField
创建一个标记选择的字段
方法
public static string TagField(string tag, params GUILayoutOption[] options);
public static string TagField(string tag, GUIStyle style, params GUILayoutOption[] options);
public static string TagField(string label, string tag, params GUILayoutOption[] options);
public static string TagField(string label, string tag, GUIStyle style, params GUILayoutOption[] options);
public static string TagField(GUIContent label, string tag, params GUILayoutOption[] options);
public static string TagField(GUIContent label, string tag, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在字段前的可选标签
tag 字段显示的标记
style 可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
string 用户选择的标记
TextArea
创建一个文本区域
方法
public static string TextArea(string text, params GUILayoutOption[] options);
public static string TextArea(string text, GUIStyle style, params GUILayoutOption[] options);
参数
text 要编辑的文本
style 可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
string 用户输入的文本
TextField
创建一个文本字段
方法
public static string TextField(string text, params GUILayoutOption[] options);
public static string TextField(string text, GUIStyle style, params GUILayoutOption[] options);
public static string TextField(string label, string text, params GUILayoutOption[] options);
public static string TextField(string label, string text, GUIStyle style, params GUILayoutOption[] options);
public static string TextField(GUIContent label, string text, params GUILayoutOption[] options);
public static string TextField(GUIContent label, string text, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在字段前的可选标签
text 要编辑的文本
style 可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
string 用户输入的文本
Toggle
创建一个切换按钮
方法
public static bool Toggle(bool value, params GUILayoutOption[] options);
public static bool Toggle(string label, bool value, params GUILayoutOption[] options);
public static bool Toggle(GUIContent label, bool value, params GUILayoutOption[] options);
public static bool Toggle(bool value, GUIStyle style, params GUILayoutOption[] options);
public static bool Toggle(string label, bool value, GUIStyle style, params GUILayoutOption[] options);
public static bool Toggle(GUIContent label, bool value, GUIStyle style, params GUILayoutOption[] options);
参数
label 显示在切换按钮前的可选标签
value 切换按钮显示的状态
style 可选GUIStyle[-]
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
bool 选择的切换按钮的状态
ToggleLeft
创建一个切换字段 其中切换在坐 标签在右
方法
public static bool ToggleLeft(string label, bool value, params GUILayoutOption[] options);
public static bool ToggleLeft(GUIContent label, bool value, params GUILayoutOption[] options);
public static bool ToggleLeft(string label, bool value, GUIStyle labelStyle, params GUILayoutOption[] options);
public static bool ToggleLeft(GUIContent label, bool value, GUIStyle labelStyle, params GUILayoutOption[] options);
Parameters
参数
label 显示在切换按钮旁边的标签
value 要编辑的值
labelStyle 用于标签的可选GUIStyle
options 指定额外布局特性的布局选项的可选择列表 这里传递的任意值都将覆盖样式指定的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
bool 选择的切换按钮的状态
Vector2Field
创建一个X和Y的字段来输入一个Vector2
方法
public static Vector2 Vector2Field(string label, Vector2 value, params GUILayoutOption[] options);
public static Vector2 Vector2Field(GUIContent label, Vector2 value, params GUILayoutOption[] options);
参数
label 显示在字段上方的标签
value 输入的值
options 指定额外布局属性的布局选项的可选列表 此处传递的任何值都将覆盖样式定义的设置
返回结果
Vector2 用户输入的值
Vector2IntField
创建一个X和Y的整数字段来输入一个Vector2Int
方法
public static Vector2Int Vector2IntField(string label, Vector2Int value, params GUILayoutOption[] options);
public static Vector2Int Vector2IntField(GUIContent label, Vector2Int value, params GUILayoutOption[] options);
参数
label 显示在字段上方的标签
value 输入的值
options 指定额外布局属性的布局选项的可选列表此处传递的任何值都将覆盖样式定义的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Vector2Int 用户输入的值
Vector3Field
创建一个X和Y和Z的字段来输入一个Vector3
方法
public static Vector3 Vector3Field(string label, Vector3 value, params GUILayoutOption[] options);
public static Vector3 Vector3Field(GUIContent label, Vector3 value, params GUILayoutOption[] options);
参数
label 显示在字段上方的标签
value 输入的值
options 指定额外布局属性的布局选项的可选列表此处传递的任何值都将覆盖样式定义的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Vector3 用户输入的值
Vector3IntField
创建一个X和Y和Z的整数字段来输入一个Vector3Int
方法
public static Vector3Int Vector3IntField(string label, Vector3Int value, params GUILayoutOption[] options);
public static Vector3Int Vector3IntField(GUIContent label, Vector3Int value, params GUILayoutOption[] options);
参数
label 显示在字段上方的标签
value 输入的值
options 指定额外布局属性的布局选项的可选列表此处传递的任何值都将覆盖样式定义的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Vector3Int 用户输入的值
Vector4Field
创建一个X和Y和Z和W的字段来输入一个Vector4
方法
public static Vector4 Vector4Field(string label, Vector4 value, params GUILayoutOption[] options);
参数
label 显示在字段上方的标签
value 输入的值
options 指定额外布局属性的布局选项的可选列表此处传递的任何值都将覆盖样式定义的设置 另见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
返回结果
Vector4 用户输入的值
https://docs.unity3d.com/ScriptReference/EditorGUILayout.html

猜你喜欢

转载自blog.csdn.net/qql7267/article/details/89328515