- BeginHorizontal
- BeginScrollView
- BeginToggleGroup
- BeginVertical
- BoundsField
- ColorField
- CurveField
- EndHorizontal
- EndScrollView
- EndToggleGroup
- EndVertical
- EnumPopup
- FloatField
- Foldout
- InspectorTitlebar
- IntField
- IntPopup
- IntSlider
- LabelField
- LayerField
- MinMaxSlider
- ObjectField
- PasswordField
- Popup
- PrefixLabel
- PropertyField
- RectField
- SelectableLabel
- Slider
- Space
- TagField
- TextArea
- TextField
- Toggle
- Vector2Field
- Vector3Field
- Vector4Field
EditorGUILayout.IntPopup 整数弹出选择菜单
static function IntPopup (selectedValue : int, displayedOptions : string[], optionValues : int[], params options : GUILayoutOption[]) : int
static function IntPopup (selectedValue : int, displayedOptions : string[], optionValues : int[], style : GUIStyle, params options : GUILayoutOption[]) : int
static function IntPopup (selectedValue : int, displayedOptions : GUIContent[], optionValues : int[], params options : GUILayoutOption[]) : int
static function IntPopup (selectedValue : int, displayedOptions : GUIContent[], optionValues : int[], style : GUIStyle, params options : GUILayoutOption[]) : int
static function IntPopup (label : string, selectedValue : int, displayedOptions : string[], optionValues : int[], params options : GUILayoutOption[]) : int
static function IntPopup (label : string, selectedValue : int, displayedOptions : string[], optionValues : int[], style : GUIStyle, params options : GUILayoutOption[]) : int
static function IntPopup (property : SerializedProperty, displayedOptions : GUIContent[], optionValues : int[], label : GUIContent, params options : GUILayoutOption[]) : void
static function IntPopup (property : SerializedProperty, displayedOptions : GUIContent[], optionValues : int[], label : GUIContent, style : GUIStyle, params options : GUILayoutOption[]) : void
static function IntPopup (label : GUIContent, selectedValue : int, displayedOptions : GUIContent[], optionValues : int[], params options : GUILayoutOption[]) : int
static function IntPopup (label : GUIContent, selectedValue : int, displayedOptions : GUIContent[], optionValues : int[], style : GUIStyle, params options : GUILayoutOption[]) : int
Parameters参数
-
labelOptional label in front of the field. // 字段前面的可选标签。
-
selectedIndexThe index of the option the field shows.
字段选项的索引 - displayedOptionsAn array with the options shown in the popup.
弹出菜单选项的数组 - optionValuesAn array with the values for each option.
每个选项带有值的数组 - styleOptional GUIStyle. // 可选样式
-
optionsAn optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style. See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
指定额外布局属性的可选列表。这里传递任意值,将覆盖样式定义的设置。
int - The value of the option that has been selected by the user.
返回整数,用户选择的选项的值。
Description描述
Make an integer popup selection field.
制作一个整数弹出选择字段。
Takes the currently selected integer as a parameter and returns the integer selected by the user.
采用当前选择的整数作为参数并返回用户选择的整数。
Rescales the current selected GameObject.
重新调整当前选项的游戏物体。
// Simple Editor Script that lets you rescale the current selected GameObject.
//重新调整当前选项的游戏物体。
class EditorGUILayoutIntPopup extends EditorWindow {
var selectedSize : int = 1;
var names : String[] = ["Normal", "Double", "Quadruple"];
var sizes : int[] = [1,2,4];
@MenuItem("Examples/Editor GUILayout Int Popup usage")
static function Init() {
var window = GetWindow(EditorGUILayoutIntPopup);
window.Show();
}
function OnGUI() {
selectedSize = EditorGUILayout.IntPopup("Resize Scale: ", selectedSize, names, sizes);
if(GUILayout.Button("Scale"))
ReScale();
}
function ReScale() {
if(Selection.activeTransform)
Selection.activeTransform.localScale =
Vector3(selectedSize, selectedSize, selectedSize);
else Debug.LogError("No Object selected, please select an object to scale.");
}
}