EditorGUI.IntPopupstatic function IntPopup (position : Rect, selectedValue : int, displayedOptions : string[], optionValues : int[], style : GUIStyle = EditorStyles.popup) : intstatic function IntPopup (position : Rect, selectedValue : int, displayedOptions : GUIContent[], optionValues : int[], style : GUIStyle = EditorStyles.popup) : intstatic function IntPopup (position : Rect, property : SerializedProperty, displayedOptions : GUIContent[], optionValues : int[], label : GUIContent) : voidstatic function IntPopup (position : Rect, label : String, selectedValue : int, displayedOptions : string[], optionValues : int[], style : GUIStyle = EditorStyles.popup) : intstatic function IntPopup (position : Rect, label : GUIContent, selectedValue : int, displayedOptions : GUIContent[], optionValues : int[], style : GUIStyle = EditorStyles.popup) : intParameters
Returnsint - The value of the option that has been selected by the user. DescriptionMake an integer popup selection field. Takes the currently selected integer as a parameter and returns the integer selected by the user.
// 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."); } }
|

