void OnGUI() { layersCustom = tagsCustom(tags()); // Get updated list of custom tags // FIRST TWO ComboBox (popup) are Here for Example Purposes ONLY EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("ComboBox via ENUM"); layer = (eLayers)EditorGUILayout.EnumPopup(layer); // ComboBox via ENUM GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("ComboBox via STRING[]"); layer = (eLayers)EditorGUILayout.Popup((int)layer, layers); // ComboBox via STRING[] GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); // ------------------------------------------------------------- EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("ComboBox via custom tags"); layerChoice = EditorGUILayout.Popup(layerChoice, layersCustom); // ComboBox via STRING[]/Tags GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); drawOptions(layersCustom[layerChoice]); // Draw custom elements depending on selected tag }
void OnGUI() { layersCustom = tagsCustom(tags()); // Get updated list of custom tags // FIRST TWO ComboBox (popup) are Here for Example Purposes ONLY EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("ComboBox via ENUM"); layer = (eLayers)EditorGUILayout.EnumPopup(layer); // ComboBox via ENUM GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("ComboBox via STRING[]"); layer = (eLayers)EditorGUILayout.Popup((int)layer, layers); // ComboBox via STRING[] GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); // ------------------------------------------------------------- EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("ComboBox via custom tags"); layerChoice = EditorGUILayout.Popup(layerChoice, layersCustom); // ComboBox via STRING[]/Tags GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); drawOptions(layersCustom[layerChoice]); // Draw custom elements depending on selected tag }