EditorGUI.Popup Manual     Reference     Scripting  
Scripting > Editor Classes > EditorGUI
EditorGUI.Popup

static function Popup (position : Rect, selectedIndex : int, displayedOptions : string[], style : GUIStyle = EditorStyles.popup) : int

static function Popup (position : Rect, selectedIndex : int, displayedOptions : GUIContent[], style : GUIStyle = EditorStyles.popup) : int

static function Popup (position : Rect, label : string, selectedIndex : int, displayedOptions : string[], style : GUIStyle = EditorStyles.popup) : int

static function Popup (position : Rect, label : GUIContent, selectedIndex : int, displayedOptions : GUIContent[], style : GUIStyle = EditorStyles.popup) : int

Parameters

NameDescription
position Rectangle on the screen to use for the field.
label Optional label in front of the field.
selectedIndex The index of the option the field shows.
displayedOptions An array with the options shown in the popup.
style Optional GUIStyle.

Returns

int - The index of the option that has been selected by the user.

Description

Make a generic popup selection field.

Takes the currently selected index as a parameter and returns the index selected by the user.