Version: 5.4
public static int IntPopup (Rect position, int selectedValue, string[] displayedOptions, int[] optionValues, GUIStyle style= EditorStyles.popup);
public static int IntPopup (Rect position, int selectedValue, GUIContent[] displayedOptions, int[] optionValues, GUIStyle style= EditorStyles.popup);
public static int IntPopup (Rect position, string label, int selectedValue, string[] displayedOptions, int[] optionValues, GUIStyle style= EditorStyles.popup);
public static int IntPopup (Rect position, GUIContent label, int selectedValue, GUIContent[] displayedOptions, int[] optionValues, GUIStyle style= EditorStyles.popup);

Parameters

position @param position Прямоугольник на экране, используемый для поля.
label @param label Необязательный текст перед полем.
selectedValue @param selected Значение enum показываемое в поле как выбранное.
displayedOptions An array with the displayed options the user can choose from.
optionValues An array with the values for each option. If optionValues a direct mapping of selectedValue to displayedOptions is assumed.
style @param style Необязательный стиль GUIStyle.

Returns

int @return Значение перечисления enum которое было выбрано пользователем.

Description

Make an integer popup selection field.

Принимает выбранное целое число в качестве параметра и возвращает целое число, выбранное пользователем.


Int Popup in an Editor Window.

	// Multiplies the scale of the selected transform.
	
	
	class EditorGUIIntPopup extends EditorWindow {

var selectedSize : int = 1; var names : String[] = ["Double", "Triple", "Quadruple"]; var sizes : int[] = [2,3,4]; @MenuItem("Examples/Editor GUI Int Popup usage") static function Init() { var window = GetWindow(EditorGUIIntPopup); window.position = Rect(0,0,180,60); window.Show(); } function OnGUI() { selectedSize = EditorGUI.IntPopup( Rect(3,3,position.width - 6,20), "Size:", selectedSize, names, sizes); if(GUI.Button(Rect(0,25,position.width,position.height - 27), "Modify")) Rescale(); } function Rescale() { if(Selection.activeTransform) Selection.activeTransform.localScale *= selectedSize; else Debug.LogError("No Object selected, please select an object to scale."); } }

public static void IntPopup (Rect position, SerializedProperty property, GUIContent[] displayedOptions, int[] optionValues, GUIContent label= null);

Parameters

position @param position Прямоугольник на экране, используемый для поля.
property The SerializedProperty to use for the control.
displayedOptions An array with the displayed options the user can choose from.
optionValues An array with the values for each option. If optionValues a direct mapping of selectedValue to displayedOptions is assumed.
label @param label Необязательный текст перед полем.

Description