Skip to content

Commit 59aaa5a

Browse files
author
David Kline
authored
Merge pull request #2375 from StephenHodgson/MRTK-vNEXT-ManagerCleanupAfterInspectorChange
Config Profile Inspector doesn't update values after change.
2 parents 0df372d + 6d2d420 commit 59aaa5a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Assets/MixedRealityToolkit/_Core/Inspectors/MixedRealityCameraProfileInspector.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ public class MixedRealityCameraProfileInspector : MixedRealityBaseConfigurationP
2020
private SerializedProperty transparentBackgroundColor;
2121
private SerializedProperty holoLensQualityLevel;
2222

23-
private GUIContent nearClipTitle = new GUIContent("Near Clip");
24-
private GUIContent clearFlagsTitle = new GUIContent("Clear Flags");
23+
private readonly GUIContent nearClipTitle = new GUIContent("Near Clip");
24+
private readonly GUIContent clearFlagsTitle = new GUIContent("Clear Flags");
2525

2626
private void OnEnable()
2727
{
28-
if (!CheckMixedRealityManager())
28+
if (!CheckMixedRealityManager(false))
2929
{
3030
return;
3131
}

Assets/MixedRealityToolkit/_Core/Inspectors/MixedRealityConfigurationProfileInspector.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public class MixedRealityConfigurationProfileInspector : MixedRealityBaseConfigu
2525
private SerializedProperty controllersProfile;
2626
private SerializedProperty enableBoundarySystem;
2727

28+
private MixedRealityConfigurationProfile configurationProfile;
29+
2830
private void OnEnable()
2931
{
3032
// Create The MR Manager if none exists.
@@ -55,6 +57,7 @@ private void OnEnable()
5557
}
5658
}
5759

60+
configurationProfile = target as MixedRealityConfigurationProfile;
5861
enableCameraProfile = serializedObject.FindProperty("enableCameraProfile");
5962
cameraProfile = serializedObject.FindProperty("cameraProfile");
6063
enableInputSystem = serializedObject.FindProperty("enableInputSystem");
@@ -74,6 +77,7 @@ public override void OnInspectorGUI()
7477

7578
var previousLabelWidth = EditorGUIUtility.labelWidth;
7679
EditorGUIUtility.labelWidth = 160f;
80+
EditorGUI.BeginChangeCheck();
7781

7882
// Camera Profile Configuration
7983
EditorGUILayout.LabelField("Camera Settings", EditorStyles.boldLabel);
@@ -117,6 +121,11 @@ public override void OnInspectorGUI()
117121

118122
EditorGUIUtility.labelWidth = previousLabelWidth;
119123
serializedObject.ApplyModifiedProperties();
124+
125+
if (EditorGUI.EndChangeCheck())
126+
{
127+
MixedRealityManager.Instance.ResetConfiguration(configurationProfile);
128+
}
120129
}
121130

122131
private static void RenderProfile(SerializedProperty property)

0 commit comments

Comments
 (0)