Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Added configuration foldout to all service configuration profiles (#529)
Browse files Browse the repository at this point in the history
* added configuration foldout

* updated foldout label content to include the interface type this configuration expects
  • Loading branch information
StephenHodgson authored Apr 22, 2020
1 parent 81dbe8b commit 8cc38e1
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class MixedRealityServiceProfileInspector : BaseMixedRealityProfileInspec

private SerializedProperty configurations;

private bool showConfigurationFoldout = true;

/// <summary>
/// Gets the service constraint used to filter options listed in the
/// <see cref="configurations"/> instance type dropdown. Set after
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8cc38e1

Please sign in to comment.