Exemple #1
0
        static public T Popup <T>(GUIContent inLabel, T inCurrent, NamedItemList <T> inElementList, GUIStyle inStyle, params GUILayoutOption[] inOptions)
        {
            int currentIdx = inElementList.IndexOf(inCurrent);
            int nextIdx    = EditorGUILayout.Popup(inLabel, currentIdx, inElementList.SortedContent(), inStyle, inOptions);

            return(inElementList.Get(nextIdx, inCurrent));
        }
Exemple #2
0
        static public T Popup <T>(Rect inPosition, GUIContent inLabel, T inCurrent, NamedItemList <T> inElementList, GUIStyle inStyle)
        {
            int currentIdx = inElementList.IndexOf(inCurrent);
            int nextIdx    = EditorGUI.Popup(inPosition, inLabel, currentIdx, inElementList.SortedContent(), inStyle);

            return(inElementList.Get(nextIdx, inCurrent));
        }