public override void OnTitleContentGUI() { EditorGUILayout.Space(); GUIHelper.LineSpacer(); EditorGUILayout.Space(); string[] catergories = componentCatergories.Keys.ToArray(); catergorySelection = GUILayout.SelectionGrid(catergorySelection, catergories, 4, EditorStyles.centeredGreyMiniLabel); currentComponents = componentCatergories[catergories[catergorySelection]]; }
public override void OnTitleContentGUI() { EditorGUILayout.Space(); GUIHelper.LineSpacer(); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); { EditorGUILayout.LabelField("Prefix Settings"); GUIHelper.SerializedArraySelection(prefixes, ref prefixIndex, UpdateNames, UpdateNames); } EditorGUILayout.EndHorizontal(); prefixIndex = GUILayout.SelectionGrid(prefixIndex, prefixNames.ToArray(), 4, EditorStyles.centeredGreyMiniLabel); }
public override void OnBodyContentGUI() { if (catergorySelection == componentCatergories.Count - 1) { DrawCustoms(); return; } EditorGUILayout.BeginHorizontal(); { if (GUILayout.Button("Enable All")) { SetVisibilityForAll(true); } if (GUILayout.Button("Disable All")) { SetVisibilityForAll(false); } } EditorGUILayout.EndHorizontal(); GUIHelper.LineSpacer(); EditorGUILayout.Space(); //Draw all components for the catergory foreach (ComponentType component in currentComponents) { GUIContent content = EditorGUIUtility.ObjectContent(null, component.type); //Do not display if it's irrelevant in the first place if (content.image == null || content.image.name == "d_DefaultAsset Icon") { continue; } content.text = component.name; EditorGUILayout.BeginHorizontal(); { component.shown = EditorGUILayout.Toggle(component.shown); EditorGUILayout.LabelField(content); } EditorGUILayout.EndHorizontal(); } }