Esempio n. 1
0
        private static void CreatePopupMenuVersionControl(string title, EditorSettingsInspector.PopupElement[] elements, string selectedValue,
                                                          GenericMenu.MenuFunction2 func)
        {
            var selectedIndex =
                System.Array.FindIndex(elements, (EditorSettingsInspector.PopupElement typeElem) => (typeElem.id == selectedValue));
            var content = new GUIContent(elements[selectedIndex].content);

            EditorSettingsInspector.CreatePopupMenu(title, content, elements, selectedIndex, func);
        }
        private void CreatePopupMenuVersionControl(string title, EditorSettingsInspector.PopupElement[] elements, string selectedValue,
                                                   GenericMenu.MenuFunction2 func)
        {
            var selectedIndex = Array.FindIndex(elements, e => e.id == selectedValue);

            if (selectedIndex == -1)
            {
                selectedIndex = Array.FindIndex(elements, e => e.id == ExternalVersionControl.Generic);
            }
            var content = new GUIContent(elements[selectedIndex].content);

            EditorSettingsInspector.CreatePopupMenu(null, new GUIContent(title), content, elements, selectedIndex, func);
        }