@@ -11,6 +11,7 @@ namespace Microsoft.MixedReality.Toolkit.Editor
1111 public class MixedRealityToolkitInspector : UnityEditor . Editor
1212 {
1313 private SerializedProperty activeProfile ;
14+ private UnityEditor . Editor activeProfileEditor ;
1415
1516 private void OnEnable ( )
1617 {
@@ -33,7 +34,7 @@ public override void OnInspectorGUI()
3334 {
3435 if ( GUILayout . Button ( "Select Active Instance" ) )
3536 {
36- UnityEditor . Selection . activeGameObject = MixedRealityToolkit . Instance . gameObject ;
37+ Selection . activeGameObject = MixedRealityToolkit . Instance . gameObject ;
3738 }
3839
3940 if ( GUILayout . Button ( "Make this the Active Instance" ) )
@@ -46,7 +47,7 @@ public override void OnInspectorGUI()
4647
4748 serializedObject . Update ( ) ;
4849
49- // If not profile is assigned, then warn user
50+ // If no profile is assigned, then warn user
5051 if ( activeProfile . objectReferenceValue == null )
5152 {
5253 EditorGUILayout . HelpBox ( "MixedRealityToolkit cannot initialize unless an Active Profile is assigned!" , MessageType . Error ) ;
@@ -59,12 +60,17 @@ public override void OnInspectorGUI()
5960 if ( changed )
6061 {
6162 MixedRealityToolkit . Instance . ResetConfiguration ( ( MixedRealityToolkitConfigurationProfile ) activeProfile . objectReferenceValue ) ;
63+ activeProfileEditor = null ;
6264 }
6365
64- if ( activeProfile . objectReferenceValue != null )
66+ if ( activeProfile . objectReferenceValue != null && activeProfileEditor == null )
67+ {
68+ // For the configuration profile, show the default inspector GUI
69+ activeProfileEditor = CreateEditor ( activeProfile . objectReferenceValue ) ;
70+ }
71+
72+ if ( activeProfileEditor != null )
6573 {
66- // For configure, show the default inspector GUI
67- UnityEditor . Editor activeProfileEditor = CreateEditor ( activeProfile . objectReferenceValue ) ;
6874 activeProfileEditor . OnInspectorGUI ( ) ;
6975 }
7076 }
0 commit comments