public static Popup ( |
||
label | Optional label in front of the field. | |
selectedIndex | int | The index of the option the field shows. |
displayedOptions | An array with the options shown in the popup. | |
return | int |
public static int Popup(GUIContent label, int selectedIndex, GUIContent[] displayedOptions, params GUILayoutOption[] options)
{
return Popup(label, selectedIndex, displayedOptions, EditorStyles.popup, options);
}
EditorGUILayout::Popup ( |
|
EditorGUILayout::Popup ( int selectedIndex, |
|
EditorGUILayout::Popup ( int selectedIndex, |
|
EditorGUILayout::Popup ( int selectedIndex, string displayedOptions ) : int | |
EditorGUILayout::Popup ( int selectedIndex, string displayedOptions, |
|
EditorGUILayout::Popup ( string label, int selectedIndex, string displayedOptions ) : int | |
EditorGUILayout::Popup ( string label, int selectedIndex, string displayedOptions, |
|
EditorGUILayout::Popup ( UnityEditor.SerializedProperty property, |
|
EditorGUILayout::Popup ( UnityEditor.SerializedProperty property, |
void FromStateFilterInspector(TransitionProfile profile, FromStateFilter filter, ref Rect stateRect) { EGL.BeginHorizontal(); filter.type = (FromStateType)EGL.EnumPopup(filter.type, GL.Width(70)); if (filter.type == FromStateType.State) { EditorGUIUtil.AutoCompleteList(filter.stateOrTagName, allStateNames, str => filter.stateOrTagName = str, ref stateRect); } else if (filter.type == FromStateType.Tag) { EditorGUIUtil.AutoCompleteList(filter.stateOrTagName, transition.profile.tags, str => filter.stateOrTagName = str, ref stateRect); } if (filter.type == FromStateType.State) { var state = transition.profile.FindState(filter.stateOrTagName); if (state == null) { EGL.EndHorizontal(); EGL.HelpBox("No Source State", MessageType.Error); } else { List <string> portionSelections = new List <string>(); portionSelections.Add("<any>"); foreach (var p in state.allPortions) { portionSelections.Add(p.name); } var prevIndex = portionSelections.IndexOf(filter.portionName); if (prevIndex == -1) { prevIndex = 0; } prevIndex = EGL.Popup(prevIndex, portionSelections.ToArray()); filter.portionName = prevIndex == 0 ? "" : portionSelections[prevIndex]; if (GL.Button("Focus")) { Utils.FocusEditingAnimation(profile, state.stateName); } EGL.EndHorizontal(); } } else { EGL.EndHorizontal(); } }