// -------------------- Section public static bool DrawSection(string sectionLabel, DrawDetailsDelegate drawDetailsDlg, ref bool foldoutState, ShowSectionDelegate showDlg = null) { bool bChanged = false; EditorUI.BeginSection(); EditorGUI.BeginChangeCheck(); foldoutState = EditorUI.DrawFoldOut(foldoutState, sectionLabel); if (EditorGUI.EndChangeCheck() && showDlg != null) { showDlg(foldoutState); } if (foldoutState) { EditorUI.DrawSeparator(); EditorGUI.indentLevel++; using (var hs = new EditorGUILayout.HorizontalScope()) { using (var vs = new EditorGUILayout.VerticalScope()) { if (drawDetailsDlg != null) { bChanged |= drawDetailsDlg(); } } } EditorGUI.indentLevel--; } EditorUI.EndSection(); EditorUI.DrawSeparator(); return(bChanged); }
private static bool DrawSection(HEU_SettingsWindow settingsWindow, string sectionLabel, DrawDetailsDelegate drawDetailsDelegate, ref bool foldoutState) { bool bChanged = false; HEU_EditorUI.BeginSection(); { foldoutState = HEU_EditorUI.DrawFoldOut(foldoutState, sectionLabel); if (foldoutState) { HEU_EditorUI.DrawSeparator(); EditorGUI.indentLevel++; using (var hs = new EditorGUILayout.HorizontalScope()) { using (var vs = new EditorGUILayout.VerticalScope()) { bChanged |= drawDetailsDelegate(); } } EditorGUI.indentLevel--; } } HEU_EditorUI.EndSection(); HEU_EditorUI.DrawSeparator(); return bChanged; }