BoundsIntField
示例程序 | |
---|---|
说明 | 生成控制 BoundsField 变量的区域 |
用法
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
该区域控制的 BoundsInt
类型变量。
options
(可选)用于指定额外的布局属性,该参数将覆盖默认样式。
示例
public override void OnInspectorGUI () {
// First reload, no label, no extra options
_target.BoundsFirst = EditorGUILayout.BoundsField (_target.BoundsFirst);
// Second reload, with a label and a height of 200 pixels
_target.BoundsSecond = EditorGUILayout.BoundsField ("Bounds Second", _target.BoundsSecond, GUILayout.Height (200));
// Third reload, with a label, a tooltip and a size of 400 pixels * 100 pixels
var guiContent = new GUIContent("Bounds Third", "This is the third bounds.");
var guiLayoutOptions = new GUILayoutOption [] {
GUILayout.Width(400),
GUILayout.Height(100)
};
_target.BoundsThird = EditorGUILayout.BoundsField (guiContent, _target.BoundsThird, guiLayoutOptions);
}
编译结果如下: