void UnderList() { EditorGUILayout.BeginHorizontal(); switch (listState) { case ListState.DEFAULT: if (GUILayout.Button("Add Type")) { GUI.FocusControl(null); ElementType e = new ElementType(); if (selectedType != null) { e.parentID = selectedType.ID; } InventoryDatabase.Add(e, selectedType); editType = e; editState = EditState.EDITTYPE; } if (selectedType != null) { if (GUILayout.Button("Add Element")) { GUI.FocusControl(null); InventoryElement invEl = new InventoryElement(); InventoryDatabase.Add(invEl, selectedType); selectedItem = invEl; editItem = invEl; editState = EditState.EDITITEM; } } break; } EditorGUILayout.EndHorizontal(); }