From 8cc38e132c67293652cb50f154788dc1d5083089 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 22 Apr 2020 10:47:18 -0400 Subject: [PATCH] Added configuration foldout to all service configuration profiles (#529) * added configuration foldout * updated foldout label content to include the interface type this configuration expects --- ...dRealityServiceProviderProfileInspector.cs | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs index bc8febabd..770fde9c6 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs @@ -23,6 +23,8 @@ public class MixedRealityServiceProfileInspector : BaseMixedRealityProfileInspec private SerializedProperty configurations; + private bool showConfigurationFoldout = true; + /// /// Gets the service constraint used to filter options listed in the /// instance type dropdown. Set after @@ -56,18 +58,21 @@ protected override void OnEnable() public override void OnInspectorGUI() { EditorGUILayout.Space(); - EditorGUILayout.LabelField("Configuration Options", EditorStyles.boldLabel); - EditorGUILayout.Space(); - serializedObject.Update(); - EditorGUILayout.Space(); - configurationList.DoLayoutList(); + showConfigurationFoldout = EditorGUILayout.Foldout(showConfigurationFoldout, new GUIContent($"{ServiceConstraint.Name} Configuration Options"), true); - if (configurations == null || configurations.arraySize == 0) + if (showConfigurationFoldout) { - EditorGUILayout.HelpBox("Register a new Service Configuration", MessageType.Warning); - } + serializedObject.Update(); + EditorGUILayout.Space(); + configurationList.DoLayoutList(); - serializedObject.ApplyModifiedProperties(); + if (configurations == null || configurations.arraySize == 0) + { + EditorGUILayout.HelpBox($"Register a new {ServiceConstraint.Name} Configuration", MessageType.Warning); + } + + serializedObject.ApplyModifiedProperties(); + } } private void DrawConfigurationOptionElement(Rect rect, int index, bool isActive, bool isFocused)