void DefaultDrawCell(PresetCell cell) { EditorGUILayout.BeginVertical(); { GUILayout.FlexibleSpace(); EditorGUI.BeginDisabledGroup(!cell.enabled); GUIContent content = new GUIContent(cell.name, cell.texture); if (GUILayout.Button(content, buttonStyle, GUILayout.Width(200), GUILayout.Height(200))) { currentGraph.presetChoosed = true; cell.callback(); currentGraph.UpdateComputeOrder(); } EditorGUI.EndDisabledGroup(); GUILayout.FlexibleSpace(); } EditorGUILayout.EndVertical(); }
bool DefaultDrawCell(PresetCell cell, bool selected, int columnIndex) { bool pressed = false; EditorGUILayout.BeginVertical(); { EditorGUI.BeginDisabledGroup(!cell.enabled); GUIContent content = new GUIContent(cell.name, cell.texture); if (GUILayout.Button(content, (selected) ? selectedButtonStyle : buttonStyle, GUILayout.Width(200), GUILayout.Height(200))) { pressed = true; if (cell.callback != null) { cell.callback(); } } EditorGUI.EndDisabledGroup(); } EditorGUILayout.EndVertical(); return(pressed); }