private void GUISingleFlag(string flagName, string label, string tooltip = null, bool enabled = true, bool increaseIndentLevel = false, bool visible = true, string helpTopic = null) { if (!enabled) { GUI.enabled = false; } if (increaseIndentLevel) { label = "▪ " + label; } bool flag = TCP2_ShaderGeneratorUtils.HasFeatures(mCurrentConfig.Flags, flagName); if (visible) { EditorGUILayout.BeginHorizontal(); if (increaseIndentLevel) { TCP2_GUI.SubHeader(label, tooltip, flag, 165); flag = EditorGUILayout.Toggle(flag); } else { GUI.enabled = mGUIEnabled; if (!string.IsNullOrEmpty(helpTopic)) { TCP2_GUI.HelpButton(label.TrimStart('▪', ' '), string.IsNullOrEmpty(helpTopic) ? label.TrimStart('▪', ' ') : helpTopic); } GUI.enabled = enabled; TCP2_GUI.SubHeader(label, tooltip, flag, 145); flag = EditorGUILayout.Toggle(flag); } EditorGUILayout.EndHorizontal(); } TCP2_ShaderGeneratorUtils.ToggleFlag(mCurrentConfig.Flags, flagName, flag); if (!enabled) { GUI.enabled = mGUIEnabled; } }