internal void OnGuiVertical(BuildPlatform platform) { EditorGUILayout.BeginVertical(); foreach (GraphicsTier tier in Enum.GetValues(typeof(GraphicsTier))) { bool autoSettings = EditorGraphicsSettings.AreTierSettingsAutomatic(platform.namedBuildTarget.ToBuildTargetGroup(), tier); EditorGUI.BeginChangeCheck(); { GUILayout.BeginHorizontal(); EditorGUIUtility.labelWidth = 80; EditorGUILayout.LabelField(Styles.tierName[(int)tier], EditorStyles.boldLabel); GUILayout.FlexibleSpace(); EditorGUIUtility.labelWidth = 80; autoSettings = EditorGUILayout.Toggle(Styles.autoSettings, autoSettings); GUILayout.EndHorizontal(); } if (EditorGUI.EndChangeCheck()) { EditorGraphicsSettings.RegisterUndo(); EditorGraphicsSettings.MakeTierSettingsAutomatic(platform.namedBuildTarget.ToBuildTargetGroup(), tier, autoSettings); EditorGraphicsSettings.OnUpdateTierSettings(platform.namedBuildTarget.ToBuildTargetGroup(), true); } using (new EditorGUI.DisabledScope(autoSettings)) { EditorGUI.indentLevel++; EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical(); EditorGUIUtility.labelWidth = 140; OnFieldLabelsGUI(true); EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical(); EditorGUIUtility.labelWidth = 50; OnTierGUI(platform, tier, true); EditorGUILayout.EndVertical(); GUILayout.EndHorizontal(); EditorGUI.indentLevel--; } } GUILayout.EndVertical(); EditorGUIUtility.labelWidth = 0; }
internal void OnGuiHorizontal(BuildTargetGroup platform) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical(); EditorGUIUtility.labelWidth = 140; EditorGUILayout.LabelField(Styles.empty, EditorStyles.boldLabel); OnFieldLabelsGUI(false); EditorGUILayout.LabelField(Styles.empty, EditorStyles.boldLabel); EditorGUILayout.LabelField(Styles.autoSettings, EditorStyles.boldLabel); EditorGUILayout.EndVertical(); EditorGUIUtility.labelWidth = 50; foreach (GraphicsTier tier in Enum.GetValues(typeof(GraphicsTier))) { bool autoSettings = EditorGraphicsSettings.AreTierSettingsAutomatic(platform, tier); EditorGUILayout.BeginVertical(); EditorGUILayout.LabelField(Styles.tierName[(int)tier], EditorStyles.boldLabel); using (new EditorGUI.DisabledScope(autoSettings)) OnTierGUI(platform, tier, false); EditorGUILayout.LabelField(Styles.empty, EditorStyles.boldLabel); EditorGUI.BeginChangeCheck(); autoSettings = EditorGUILayout.Toggle(autoSettings); if (EditorGUI.EndChangeCheck()) { EditorGraphicsSettings.RegisterUndo(); EditorGraphicsSettings.MakeTierSettingsAutomatic(platform, tier, autoSettings); EditorGraphicsSettings.OnUpdateTierSettings(platform, true); } EditorGUILayout.EndVertical(); } EditorGUIUtility.labelWidth = 0; EditorGUILayout.EndHorizontal(); }