From af6360bfe7ca89de75c023c45fef811dc88c1dbd Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 11:32:00 -0400 Subject: [PATCH 01/14] Renamed the MixedRealityConfigurationProfile to MixedReaklityRootProfile There was some confusion about the difference between a configurations and profiles, so this rename should help clear that up --- Submodules/SDK | 2 +- XRTK-Core/Assets/XRTK.Tests/TestUtilities.cs | 6 +- .../Definitions/BaseMixedRealityProfile.cs | 3 + .../MixedRealityServiceConfiguration.cs | 19 ++--- ...e.cs => MixedRealityToolkitRootProfile.cs} | 14 ++-- ...=> MixedRealityToolkitRootProfile.cs.meta} | 0 .../MixedRealityToolkitInspector.cs | 24 +++---- .../BaseMixedRealityProfileInspector.cs | 8 +-- ...RealityToolkitSettingsProfileInspector.cs} | 70 ++++++++++--------- ...tyToolkitSettingsProfileInspector.cs.meta} | 0 .../IMixedRealityServiceConfiguration.cs | 2 +- .../Services/MixedRealityToolkit.cs | 8 +-- 12 files changed, 83 insertions(+), 73 deletions(-) rename XRTK-Core/Packages/com.xrtk.core/Definitions/{MixedRealityToolkitConfigurationProfile.cs => MixedRealityToolkitRootProfile.cs} (96%) rename XRTK-Core/Packages/com.xrtk.core/Definitions/{MixedRealityToolkitConfigurationProfile.cs.meta => MixedRealityToolkitRootProfile.cs.meta} (100%) rename XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/{MixedRealityToolkitConfigurationProfileInspector.cs => MixedRealityToolkitSettingsProfileInspector.cs} (83%) rename XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/{MixedRealityToolkitConfigurationProfileInspector.cs.meta => MixedRealityToolkitSettingsProfileInspector.cs.meta} (100%) diff --git a/Submodules/SDK b/Submodules/SDK index 844a0638c..eedfebb3b 160000 --- a/Submodules/SDK +++ b/Submodules/SDK @@ -1 +1 @@ -Subproject commit 844a0638cb422c6b7006eb6c37ee69b24010f2c5 +Subproject commit eedfebb3b05b0b14caf148f6e98c3409a2a79102 diff --git a/XRTK-Core/Assets/XRTK.Tests/TestUtilities.cs b/XRTK-Core/Assets/XRTK.Tests/TestUtilities.cs index 3cd245cd4..15624947a 100644 --- a/XRTK-Core/Assets/XRTK.Tests/TestUtilities.cs +++ b/XRTK-Core/Assets/XRTK.Tests/TestUtilities.cs @@ -38,10 +38,10 @@ public static void InitializeMixedRealityToolkitScene(bool useDefaultProfile = f Assert.IsFalse(MixedRealityToolkit.HasActiveProfile); var configuration = useDefaultProfile - ? GetDefaultMixedRealityProfile() - : ScriptableObject.CreateInstance(); + ? GetDefaultMixedRealityProfile() + : ScriptableObject.CreateInstance(); - Assert.IsTrue(configuration != null, "Failed to find the Default Mixed Reality Configuration Profile"); + Assert.IsTrue(configuration != null, "Failed to find the Default Mixed Reality Settings Profile"); MixedRealityToolkit.Instance.ResetConfiguration(configuration); Assert.IsTrue(MixedRealityToolkit.Instance.ActiveProfile != null); Assert.IsTrue(MixedRealityToolkit.IsInitialized); diff --git a/XRTK-Core/Packages/com.xrtk.core/Definitions/BaseMixedRealityProfile.cs b/XRTK-Core/Packages/com.xrtk.core/Definitions/BaseMixedRealityProfile.cs index 188ac6c55..49a2a9f23 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Definitions/BaseMixedRealityProfile.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Definitions/BaseMixedRealityProfile.cs @@ -6,6 +6,9 @@ namespace XRTK.Definitions { + /// + /// Base Profile for all data containers to use in the Mixed Reality Toolkit. + /// public abstract class BaseMixedRealityProfile : ScriptableObject { [SerializeField] diff --git a/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs b/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs index 4a3020228..c265ecaa1 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs @@ -17,8 +17,8 @@ public class MixedRealityServiceConfiguration : MixedRealityServiceConfigurat where T : IMixedRealityService { /// - public MixedRealityServiceConfiguration(SystemType instancedType, string name, uint priority, IReadOnlyList runtimePlatforms, BaseMixedRealityProfile configurationProfile) - : base(instancedType, name, priority, runtimePlatforms, configurationProfile) + public MixedRealityServiceConfiguration(SystemType instancedType, string name, uint priority, IReadOnlyList runtimePlatforms, BaseMixedRealityProfile profile) + : base(instancedType, name, priority, runtimePlatforms, profile) { } } @@ -36,8 +36,8 @@ public class MixedRealityServiceConfiguration : IMixedRealityServiceConfiguratio /// The simple, human readable name for the . /// The priority this will be initialized in. /// runtimePlatform">The runtime platform(s) to run this to run on. - /// The configuration profile for . - public MixedRealityServiceConfiguration(SystemType instancedType, string name, uint priority, IReadOnlyList runtimePlatforms, BaseMixedRealityProfile configurationProfile) + /// The configuration profile for . + public MixedRealityServiceConfiguration(SystemType instancedType, string name, uint priority, IReadOnlyList runtimePlatforms, BaseMixedRealityProfile profile) { this.instancedType = instancedType; this.name = name; @@ -55,7 +55,7 @@ public MixedRealityServiceConfiguration(SystemType instancedType, string name, u platformEntries = new RuntimePlatformEntry(runtimePlatforms); } - this.configurationProfile = configurationProfile; + this.profile = profile; } [SerializeField] @@ -142,13 +142,14 @@ public IReadOnlyList RuntimePlatforms } [SerializeField] - private BaseMixedRealityProfile configurationProfile; + [FormerlySerializedAs("configurationProfile")] + private BaseMixedRealityProfile profile; /// public BaseMixedRealityProfile ConfigurationProfile { - get => configurationProfile; - internal set => configurationProfile = value; + get => profile; + internal set => profile = value; } } -} +} \ No newline at end of file diff --git a/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitConfigurationProfile.cs b/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitRootProfile.cs similarity index 96% rename from XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitConfigurationProfile.cs rename to XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitRootProfile.cs index 06bb2891e..355c8f742 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitConfigurationProfile.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitRootProfile.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; @@ -20,12 +20,12 @@ namespace XRTK.Definitions { /// - /// Configuration profile settings for the Mixed Reality Toolkit. + /// The root profile for the Mixed Reality Toolkit's settings. /// - [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Mixed Reality Toolkit Configuration Profile", fileName = "MixedRealityToolkitConfigurationProfile", order = (int)CreateProfileMenuItemIndices.Configuration)] - public class MixedRealityToolkitConfigurationProfile : BaseMixedRealityProfile + [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Mixed Reality Toolkit Root Profile", fileName = "MixedRealityToolkitRootProfile", order = (int)CreateProfileMenuItemIndices.Configuration)] + public class MixedRealityToolkitRootProfile : BaseMixedRealityProfile { - #region Mixed Reality Toolkit configurable properties + #region Mixed Reality Toolkit system properties #region Camera System Properties @@ -323,6 +323,8 @@ public SystemType DiagnosticsSystemSystemType #endregion Diagnostics System Properties + #endregion Mixed Reality Toolkit system properties + [SerializeField] [Tooltip("All the additional non-required services registered with the Mixed Reality Toolkit.")] private MixedRealityRegisteredServiceProvidersProfile registeredServiceProvidersProfile = null; @@ -335,7 +337,5 @@ public MixedRealityRegisteredServiceProvidersProfile RegisteredServiceProvidersP get => registeredServiceProvidersProfile; internal set => registeredServiceProvidersProfile = value; } - - #endregion Mixed Reality Toolkit configurable properties } } diff --git a/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitConfigurationProfile.cs.meta b/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitRootProfile.cs.meta similarity index 100% rename from XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitConfigurationProfile.cs.meta rename to XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitRootProfile.cs.meta diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/MixedRealityToolkitInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/MixedRealityToolkitInspector.cs index e4b836e85..674b5c226 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/MixedRealityToolkitInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/MixedRealityToolkitInspector.cs @@ -25,7 +25,7 @@ public class MixedRealityToolkitInspector : BaseMixedRealityToolkitInspector private void OnEnable() { - activeProfile = serializedObject.FindProperty("activeProfile"); + activeProfile = serializedObject.FindProperty(nameof(activeProfile)); currentPickerWindow = -1; checkChange = activeProfile.objectReferenceValue == null; } @@ -39,22 +39,22 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(activeProfile); var changed = EditorGUI.EndChangeCheck(); var commandName = Event.current.commandName; - var allConfigProfiles = ScriptableObjectExtensions.GetAllInstances(); + var profiles = ScriptableObjectExtensions.GetAllInstances(); if (activeProfile.objectReferenceValue == null) { if (currentPickerWindow == -1 && checkChange) { - if (allConfigProfiles.Length > 1) + if (profiles.Length > 1) { EditorUtility.DisplayDialog("Attention!", "You must choose a profile for the Mixed Reality Toolkit.", "OK"); currentPickerWindow = GUIUtility.GetControlID(FocusType.Passive); - EditorGUIUtility.ShowObjectPicker( - GetDefaultProfile(allConfigProfiles), false, string.Empty, currentPickerWindow); + EditorGUIUtility.ShowObjectPicker( + GetDefaultProfile(profiles), false, string.Empty, currentPickerWindow); } - else if (allConfigProfiles.Length == 1) + else if (profiles.Length == 1) { - var profile = allConfigProfiles[0]; + var profile = profiles[0]; activeProfile.objectReferenceValue = profile; changed = true; EditorApplication.delayCall += () => @@ -67,9 +67,9 @@ public override void OnInspectorGUI() checkChange = false; } - if (GUILayout.Button("Create new configuration")) + if (GUILayout.Button("Create new settings profile")) { - var profile = CreateInstance(nameof(MixedRealityToolkitConfigurationProfile)); + var profile = CreateInstance(nameof(MixedRealityToolkitRootProfile)); profile.CreateAsset(); activeProfile.objectReferenceValue = profile; } @@ -100,7 +100,7 @@ public override void OnInspectorGUI() if (changed) { - EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration((MixedRealityToolkitConfigurationProfile)activeProfile.objectReferenceValue); + EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration((MixedRealityToolkitRootProfile)activeProfile.objectReferenceValue); } } @@ -166,9 +166,9 @@ void SetStartScene() } } - private static MixedRealityToolkitConfigurationProfile GetDefaultProfile(IEnumerable allProfiles) + private static MixedRealityToolkitRootProfile GetDefaultProfile(IEnumerable profiles) { - return allProfiles.FirstOrDefault(profile => profile.name == "DefaultMixedRealityToolkitConfigurationProfile"); + return profiles.FirstOrDefault(profile => profile.name == $"Default{nameof(MixedRealityToolkitRootProfile)}"); } } } \ No newline at end of file diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs index 43194dc55..30eb3b089 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs @@ -117,7 +117,7 @@ private static bool RenderProfileInternal(BaseMixedRealityProfile parentProfile, var renderedProfile = property.objectReferenceValue as BaseMixedRealityProfile; Debug.Assert(renderedProfile != null); - if (!(renderedProfile is MixedRealityToolkitConfigurationProfile) && + if (!(renderedProfile is MixedRealityToolkitRootProfile) && (renderedProfile.ParentProfile == null || renderedProfile.ParentProfile != parentProfile)) { @@ -204,11 +204,11 @@ protected static async void CreateCloneProfile() if (!profileToCopy.IsEditable) { - // For now we only replace it if it's the master configuration profile. - // Sub-profiles are easy to update in the master configuration inspector. + // For now we only replace it if it's the master settings profile. + // Sub-profiles are easy to update in the master settings inspector. if (MixedRealityToolkit.Instance.ActiveProfile.GetType() == profile.GetType()) { - MixedRealityToolkit.Instance.ActiveProfile = profile as MixedRealityToolkitConfigurationProfile; + MixedRealityToolkit.Instance.ActiveProfile = profile as MixedRealityToolkitRootProfile; } } } diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitConfigurationProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs similarity index 83% rename from XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitConfigurationProfileInspector.cs rename to XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs index 692e37d5b..fe58266f0 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitConfigurationProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; @@ -11,32 +11,38 @@ namespace XRTK.Inspectors.Profiles { - [CustomEditor(typeof(MixedRealityToolkitConfigurationProfile))] - public class MixedRealityToolkitConfigurationProfileInspector : BaseMixedRealityProfileInspector + [CustomEditor(typeof(MixedRealityToolkitRootProfile))] + public class MixedRealityToolkitSettingsProfileInspector : BaseMixedRealityProfileInspector { // Camera system properties private SerializedProperty enableCameraSystem; private SerializedProperty cameraSystemType; private SerializedProperty cameraProfile; + // Input system properties private SerializedProperty enableInputSystem; private SerializedProperty inputSystemType; private SerializedProperty inputSystemProfile; + // Boundary system properties private SerializedProperty enableBoundarySystem; private SerializedProperty boundarySystemType; private SerializedProperty boundaryVisualizationProfile; + // Teleport system properties private SerializedProperty enableTeleportSystem; private SerializedProperty teleportSystemType; + // Spatial Awareness system properties private SerializedProperty enableSpatialAwarenessSystem; private SerializedProperty spatialAwarenessSystemType; private SerializedProperty spatialAwarenessProfile; + // Networking system properties private SerializedProperty enableNetworkingSystem; private SerializedProperty networkingSystemType; private SerializedProperty networkingSystemProfile; + // Diagnostic system properties private SerializedProperty enableDiagnosticsSystem; private SerializedProperty diagnosticsSystemType; @@ -45,13 +51,13 @@ public class MixedRealityToolkitConfigurationProfileInspector : BaseMixedReality // Additional registered components profile private SerializedProperty registeredServiceProvidersProfile; - private MixedRealityToolkitConfigurationProfile configurationProfile; + private MixedRealityToolkitRootProfile rootProfile; protected override void OnEnable() { base.OnEnable(); - configurationProfile = target as MixedRealityToolkitConfigurationProfile; + rootProfile = target as MixedRealityToolkitRootProfile; var prefabStage = PrefabStageUtility.GetCurrentPrefabStage(); @@ -77,7 +83,7 @@ protected override void OnEnable() Debug.Assert(playspace != null); } - MixedRealityToolkit.Instance.ActiveProfile = configurationProfile; + MixedRealityToolkit.Instance.ActiveProfile = rootProfile; } else { @@ -87,41 +93,41 @@ protected override void OnEnable() } // Camera system configuration - enableCameraSystem = serializedObject.FindProperty("enableCameraSystem"); - cameraSystemType = serializedObject.FindProperty("cameraSystemType"); - cameraProfile = serializedObject.FindProperty("cameraProfile"); + enableCameraSystem = serializedObject.FindProperty(nameof(enableCameraSystem)); + cameraSystemType = serializedObject.FindProperty(nameof(cameraSystemType)); + cameraProfile = serializedObject.FindProperty(nameof(cameraProfile)); // Input system configuration - enableInputSystem = serializedObject.FindProperty("enableInputSystem"); - inputSystemType = serializedObject.FindProperty("inputSystemType"); - inputSystemProfile = serializedObject.FindProperty("inputSystemProfile"); + enableInputSystem = serializedObject.FindProperty(nameof(enableInputSystem)); + inputSystemType = serializedObject.FindProperty(nameof(inputSystemType)); + inputSystemProfile = serializedObject.FindProperty(nameof(inputSystemProfile)); // Boundary system configuration - enableBoundarySystem = serializedObject.FindProperty("enableBoundarySystem"); - boundarySystemType = serializedObject.FindProperty("boundarySystemType"); - boundaryVisualizationProfile = serializedObject.FindProperty("boundaryVisualizationProfile"); + enableBoundarySystem = serializedObject.FindProperty(nameof(enableBoundarySystem)); + boundarySystemType = serializedObject.FindProperty(nameof(boundarySystemType)); + boundaryVisualizationProfile = serializedObject.FindProperty(nameof(boundaryVisualizationProfile)); // Teleport system configuration - enableTeleportSystem = serializedObject.FindProperty("enableTeleportSystem"); - teleportSystemType = serializedObject.FindProperty("teleportSystemType"); + enableTeleportSystem = serializedObject.FindProperty(nameof(enableTeleportSystem)); + teleportSystemType = serializedObject.FindProperty(nameof(teleportSystemType)); // Spatial Awareness system configuration - enableSpatialAwarenessSystem = serializedObject.FindProperty("enableSpatialAwarenessSystem"); - spatialAwarenessSystemType = serializedObject.FindProperty("spatialAwarenessSystemType"); - spatialAwarenessProfile = serializedObject.FindProperty("spatialAwarenessProfile"); + enableSpatialAwarenessSystem = serializedObject.FindProperty(nameof(enableSpatialAwarenessSystem)); + spatialAwarenessSystemType = serializedObject.FindProperty(nameof(spatialAwarenessSystemType)); + spatialAwarenessProfile = serializedObject.FindProperty(nameof(spatialAwarenessProfile)); // Networking system configuration - enableNetworkingSystem = serializedObject.FindProperty("enableNetworkingSystem"); - networkingSystemType = serializedObject.FindProperty("networkingSystemType"); - networkingSystemProfile = serializedObject.FindProperty("networkingSystemProfile"); + enableNetworkingSystem = serializedObject.FindProperty(nameof(enableNetworkingSystem)); + networkingSystemType = serializedObject.FindProperty(nameof(networkingSystemType)); + networkingSystemProfile = serializedObject.FindProperty(nameof(networkingSystemProfile)); // Diagnostics system configuration - enableDiagnosticsSystem = serializedObject.FindProperty("enableDiagnosticsSystem"); - diagnosticsSystemType = serializedObject.FindProperty("diagnosticsSystemType"); - diagnosticsSystemProfile = serializedObject.FindProperty("diagnosticsSystemProfile"); + enableDiagnosticsSystem = serializedObject.FindProperty(nameof(enableDiagnosticsSystem)); + diagnosticsSystemType = serializedObject.FindProperty(nameof(diagnosticsSystemType)); + diagnosticsSystemProfile = serializedObject.FindProperty(nameof(diagnosticsSystemProfile)); // Additional registered components configuration - registeredServiceProvidersProfile = serializedObject.FindProperty("registeredServiceProvidersProfile"); + registeredServiceProvidersProfile = serializedObject.FindProperty(nameof(registeredServiceProvidersProfile)); } public override void OnInspectorGUI() @@ -131,7 +137,7 @@ public override void OnInspectorGUI() if (!MixedRealityToolkit.IsInitialized) { return; } - if (!configurationProfile.IsEditable) + if (!rootProfile.IsEditable) { EditorGUILayout.HelpBox("The Mixed Reality Toolkit's core SDK profiles can be used to get up and running quickly.\n\n" + "You can use the default profiles provided, copy and customize the default profiles, or create your own.", MessageType.Warning); @@ -144,8 +150,8 @@ public override void OnInspectorGUI() if (GUILayout.Button("Create new profiles")) { - var profile = CreateInstance(nameof(MixedRealityToolkitConfigurationProfile)); - var newProfile = profile.CreateAsset() as MixedRealityToolkitConfigurationProfile; + var profile = CreateInstance(nameof(MixedRealityToolkitRootProfile)); + var newProfile = profile.CreateAsset() as MixedRealityToolkitRootProfile; MixedRealityToolkit.Instance.ActiveProfile = newProfile; } @@ -225,9 +231,9 @@ public override void OnInspectorGUI() if (changed && MixedRealityToolkit.IsInitialized && - MixedRealityToolkit.Instance.ActiveProfile == configurationProfile) + MixedRealityToolkit.Instance.ActiveProfile == rootProfile) { - EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration(configurationProfile); + EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration(rootProfile); } } } diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitConfigurationProfileInspector.cs.meta b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs.meta similarity index 100% rename from XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitConfigurationProfileInspector.cs.meta rename to XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs.meta diff --git a/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs b/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs index 1c4fbdc5b..b0c219809 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs @@ -49,7 +49,7 @@ public interface IMixedRealityServiceConfiguration IReadOnlyList RuntimePlatforms { get; } /// - /// The configuration profile for the . + /// The profile settings for the . /// BaseMixedRealityProfile ConfigurationProfile { get; } } diff --git a/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs b/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs index 43748d86f..2973e3604 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs @@ -59,12 +59,12 @@ public static bool HasActiveProfile /// [SerializeField] [Tooltip("The current active configuration for the Mixed Reality project")] - private MixedRealityToolkitConfigurationProfile activeProfile = null; + private MixedRealityToolkitRootProfile activeProfile = null; /// /// The public property of the Active Profile, ensuring events are raised on the change of the configuration /// - public MixedRealityToolkitConfigurationProfile ActiveProfile + public MixedRealityToolkitRootProfile ActiveProfile { get { @@ -88,7 +88,7 @@ public MixedRealityToolkitConfigurationProfile ActiveProfile /// When a configuration Profile is replaced with a new configuration, force all services to reset and read the new values /// /// - public void ResetConfiguration(MixedRealityToolkitConfigurationProfile profile) + public void ResetConfiguration(MixedRealityToolkitRootProfile profile) { if (isResetting) { @@ -457,7 +457,7 @@ private void InitializeServiceLocator() if (ActiveProfile.IsTeleportSystemEnabled) { // Note: The Teleport system doesn't have a profile, but might in the future. - var dummyProfile = ScriptableObject.CreateInstance(); + var dummyProfile = ScriptableObject.CreateInstance(); if (!CreateAndRegisterService(ActiveProfile.TeleportSystemSystemType, dummyProfile) || TeleportSystem == null) { From bbecc5a93f05959992b313d7d2d120a1f35d2fbd Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 11:40:05 -0400 Subject: [PATCH 02/14] Update XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs --- .../Packages/com.xrtk.core/Services/MixedRealityToolkit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs b/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs index 2973e3604..ef9af0b47 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs @@ -58,7 +58,7 @@ public static bool HasActiveProfile /// *Note configuration is used on project initialization or replacement, changes to properties while it is running has no effect. /// [SerializeField] - [Tooltip("The current active configuration for the Mixed Reality project")] + [Tooltip("The current active settings for the Mixed Reality project")] private MixedRealityToolkitRootProfile activeProfile = null; /// From fad4d8e40686d3115da8399c4a8de6cee5d7398d Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 11:50:30 -0400 Subject: [PATCH 03/14] Removed more references to configuration when we meant profile --- ...TestFixture_01_MixedRealityToolkitTests.cs | 4 +-- XRTK-Core/Assets/XRTK.Tests/TestUtilities.cs | 2 +- .../BaseMixedRealityServiceProfile.cs | 4 +-- .../MixedRealityServiceConfiguration.cs | 2 +- .../MixedRealityToolkitRootProfile.cs | 2 +- .../MixedRealityToolkitInspector.cs | 2 +- ...alityControllerMappingProfilesInspector.cs | 2 +- ...MixedRealityInputSystemProfileInspector.cs | 2 +- .../MixedRealityCameraProfileInspector.cs | 2 +- ...dRealityServiceProviderProfileInspector.cs | 4 +-- ...dRealityToolkitSettingsProfileInspector.cs | 2 +- .../IMixedRealityServiceConfiguration.cs | 2 +- .../Services/MixedRealityToolkit.cs | 32 +++++++++---------- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/XRTK-Core/Assets/XRTK.Tests/Core/TestFixture_01_MixedRealityToolkitTests.cs b/XRTK-Core/Assets/XRTK.Tests/Core/TestFixture_01_MixedRealityToolkitTests.cs index b1baef340..6d428e7f0 100644 --- a/XRTK-Core/Assets/XRTK.Tests/Core/TestFixture_01_MixedRealityToolkitTests.cs +++ b/XRTK-Core/Assets/XRTK.Tests/Core/TestFixture_01_MixedRealityToolkitTests.cs @@ -31,7 +31,7 @@ public void Test_01_InitializeMixedRealityToolkit() } [Test] - public void Test_02_TestNoMixedRealityConfigurationFound() + public void Test_02_TestNoMixedRealityProfileFound() { // Setup TestUtilities.CleanupScene(); @@ -48,7 +48,7 @@ public void Test_02_TestNoMixedRealityConfigurationFound() Assert.IsFalse(MixedRealityToolkit.HasActiveProfile); Assert.IsNull(MixedRealityToolkit.Instance.ActiveProfile); Assert.IsFalse(MixedRealityToolkit.HasActiveProfile); - LogAssert.Expect(LogType.Error, "No Mixed Reality Configuration Profile found, cannot initialize the Mixed Reality Toolkit"); + LogAssert.Expect(LogType.Error, "No Mixed Reality Root Profile found, cannot initialize the Mixed Reality Toolkit"); } [Test] diff --git a/XRTK-Core/Assets/XRTK.Tests/TestUtilities.cs b/XRTK-Core/Assets/XRTK.Tests/TestUtilities.cs index 15624947a..9821750bb 100644 --- a/XRTK-Core/Assets/XRTK.Tests/TestUtilities.cs +++ b/XRTK-Core/Assets/XRTK.Tests/TestUtilities.cs @@ -42,7 +42,7 @@ public static void InitializeMixedRealityToolkitScene(bool useDefaultProfile = f : ScriptableObject.CreateInstance(); Assert.IsTrue(configuration != null, "Failed to find the Default Mixed Reality Settings Profile"); - MixedRealityToolkit.Instance.ResetConfiguration(configuration); + MixedRealityToolkit.Instance.ResetProfile(configuration); Assert.IsTrue(MixedRealityToolkit.Instance.ActiveProfile != null); Assert.IsTrue(MixedRealityToolkit.IsInitialized); } diff --git a/XRTK-Core/Packages/com.xrtk.core/Definitions/BaseMixedRealityServiceProfile.cs b/XRTK-Core/Packages/com.xrtk.core/Definitions/BaseMixedRealityServiceProfile.cs index 381a25c8d..6005d8055 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Definitions/BaseMixedRealityServiceProfile.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Definitions/BaseMixedRealityServiceProfile.cs @@ -36,7 +36,7 @@ public MixedRealityServiceConfiguration[] RegisteredServiceConfigurati { var cachedConfig = configurations[i]; Debug.Assert(cachedConfig != null); - var serviceConfig = new MixedRealityServiceConfiguration(cachedConfig.InstancedType, cachedConfig.Name, cachedConfig.Priority, cachedConfig.RuntimePlatforms, cachedConfig.ConfigurationProfile); + var serviceConfig = new MixedRealityServiceConfiguration(cachedConfig.InstancedType, cachedConfig.Name, cachedConfig.Priority, cachedConfig.RuntimePlatforms, cachedConfig.Profile); Debug.Assert(serviceConfig != null); serviceConfigurations[i] = serviceConfig; } @@ -59,7 +59,7 @@ internal set { var serviceConfig = serviceConfigurations[i]; Debug.Assert(serviceConfig != null); - var newConfig = new MixedRealityServiceConfiguration(serviceConfig.InstancedType, serviceConfig.Name, serviceConfig.Priority, serviceConfig.RuntimePlatforms, serviceConfig.ConfigurationProfile); + var newConfig = new MixedRealityServiceConfiguration(serviceConfig.InstancedType, serviceConfig.Name, serviceConfig.Priority, serviceConfig.RuntimePlatforms, serviceConfig.Profile); Debug.Assert(newConfig != null); configurations[i] = newConfig; } diff --git a/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs b/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs index c265ecaa1..a99939649 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs @@ -146,7 +146,7 @@ public IReadOnlyList RuntimePlatforms private BaseMixedRealityProfile profile; /// - public BaseMixedRealityProfile ConfigurationProfile + public BaseMixedRealityProfile Profile { get => profile; internal set => profile = value; diff --git a/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitRootProfile.cs b/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitRootProfile.cs index 355c8f742..2e7c7c26a 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitRootProfile.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityToolkitRootProfile.cs @@ -23,7 +23,7 @@ namespace XRTK.Definitions /// The root profile for the Mixed Reality Toolkit's settings. /// [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Mixed Reality Toolkit Root Profile", fileName = "MixedRealityToolkitRootProfile", order = (int)CreateProfileMenuItemIndices.Configuration)] - public class MixedRealityToolkitRootProfile : BaseMixedRealityProfile + public sealed class MixedRealityToolkitRootProfile : BaseMixedRealityProfile { #region Mixed Reality Toolkit system properties diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/MixedRealityToolkitInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/MixedRealityToolkitInspector.cs index 674b5c226..72f257a05 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/MixedRealityToolkitInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/MixedRealityToolkitInspector.cs @@ -100,7 +100,7 @@ public override void OnInspectorGUI() if (changed) { - EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration((MixedRealityToolkitRootProfile)activeProfile.objectReferenceValue); + EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetProfile((MixedRealityToolkitRootProfile)activeProfile.objectReferenceValue); } } diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerMappingProfilesInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerMappingProfilesInspector.cs index 1a076e465..f64a29530 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerMappingProfilesInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerMappingProfilesInspector.cs @@ -122,7 +122,7 @@ public override void OnInspectorGUI() if (changed && MixedRealityToolkit.IsInitialized) { - EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration(MixedRealityToolkit.Instance.ActiveProfile); + EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetProfile(MixedRealityToolkit.Instance.ActiveProfile); } } } diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs index b0cc32fef..b0994f896 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs @@ -77,7 +77,7 @@ public override void OnInspectorGUI() if (changed && MixedRealityToolkit.IsInitialized) { - EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration(MixedRealityToolkit.Instance.ActiveProfile); + EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetProfile(MixedRealityToolkit.Instance.ActiveProfile); } } } diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs index a8a138ad0..d9af08e4e 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs @@ -108,7 +108,7 @@ public override void OnInspectorGUI() if (MixedRealityToolkit.IsInitialized && EditorGUI.EndChangeCheck()) { - EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration(MixedRealityToolkit.Instance.ActiveProfile); + EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetProfile(MixedRealityToolkit.Instance.ActiveProfile); } } } 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 6e1bd7dfe..7c11ba767 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs @@ -213,7 +213,7 @@ private void DrawConfigurationOptionElement(Rect rect, int index, bool isActive, if (MixedRealityToolkit.IsInitialized && !string.IsNullOrEmpty(instanceTypeProperty.FindPropertyRelative("reference").stringValue)) { - MixedRealityToolkit.Instance.ResetConfiguration(MixedRealityToolkit.Instance.ActiveProfile); + MixedRealityToolkit.Instance.ResetProfile(MixedRealityToolkit.Instance.ActiveProfile); } } @@ -260,7 +260,7 @@ private void OnConfigurationOptionRemoved(ReorderableList list) if (MixedRealityToolkit.IsInitialized) { - EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration(MixedRealityToolkit.Instance.ActiveProfile); + EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetProfile(MixedRealityToolkit.Instance.ActiveProfile); } } } diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs index fe58266f0..bc3784611 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs @@ -233,7 +233,7 @@ public override void OnInspectorGUI() MixedRealityToolkit.IsInitialized && MixedRealityToolkit.Instance.ActiveProfile == rootProfile) { - EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration(rootProfile); + EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetProfile(rootProfile); } } } diff --git a/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs b/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs index b0c219809..865c52c19 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs @@ -51,6 +51,6 @@ public interface IMixedRealityServiceConfiguration /// /// The profile settings for the . /// - BaseMixedRealityProfile ConfigurationProfile { get; } + BaseMixedRealityProfile Profile { get; } } } \ No newline at end of file diff --git a/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs b/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs index ef9af0b47..c8effc31b 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Services/MixedRealityToolkit.cs @@ -23,14 +23,14 @@ namespace XRTK.Services { /// /// This class is responsible for coordinating the operation of the Mixed Reality Toolkit. It is the only Singleton in the entire project. - /// It provides a service registry for all active services that are used within a project as well as providing the active configuration profile for the project. + /// It provides a service registry for all active services that are used within a project as well as providing the active profile for the project. /// The can be swapped out at any time to meet the needs of your project. /// [ExecuteInEditMode] [DisallowMultipleComponent] public sealed class MixedRealityToolkit : MonoBehaviour, IDisposable { - #region Mixed Reality Toolkit Profile configuration + #region Mixed Reality Toolkit Profile properties /// /// Checks if there is a valid instance of the MixedRealityToolkit, then checks if there is there a valid Active Profile. @@ -54,15 +54,15 @@ public static bool HasActiveProfile } /// - /// The active profile of the Mixed Reality Toolkit which controls which services are active and their initial configuration. - /// *Note configuration is used on project initialization or replacement, changes to properties while it is running has no effect. + /// The active profile of the Mixed Reality Toolkit which controls which services are active and their initial settings. + /// *Note a profile is used on project initialization or replacement, changes to properties while it is running has no effect. /// [SerializeField] [Tooltip("The current active settings for the Mixed Reality project")] private MixedRealityToolkitRootProfile activeProfile = null; /// - /// The public property of the Active Profile, ensuring events are raised on the change of the configuration + /// The public property of the Active Profile, ensuring events are raised on the change of the reference /// public MixedRealityToolkitRootProfile ActiveProfile { @@ -80,25 +80,25 @@ public MixedRealityToolkitRootProfile ActiveProfile } set { - ResetConfiguration(value); + ResetProfile(value); } } /// - /// When a configuration Profile is replaced with a new configuration, force all services to reset and read the new values + /// When a profile is replaced with a new one, force all services to reset and read the new values /// /// - public void ResetConfiguration(MixedRealityToolkitRootProfile profile) + public void ResetProfile(MixedRealityToolkitRootProfile profile) { if (isResetting) { - Debug.LogWarning("Already attempting to reset the configurations!"); + Debug.LogWarning("Already attempting to reset the root profile!"); return; } if (isInitializing) { - Debug.LogWarning("Already attempting to initialize the configurations!"); + Debug.LogWarning("Already attempting to initialize the root profile!"); return; } @@ -125,7 +125,7 @@ public void ResetConfiguration(MixedRealityToolkitRootProfile profile) private static bool isResetting = false; - #endregion Mixed Reality Toolkit Profile configuration + #endregion Mixed Reality Toolkit Profile properties #region Mixed Reality runtime service registry @@ -351,7 +351,7 @@ private void InitializeServiceLocator() { if (isInitializing) { - Debug.LogWarning("Already attempting to initialize the configurations!"); + Debug.LogWarning("Already attempting to initialize the service locator!"); return; } @@ -360,7 +360,7 @@ private void InitializeServiceLocator() //If the Mixed Reality Toolkit is not configured, stop. if (ActiveProfile == null) { - Debug.LogError("No Mixed Reality Configuration Profile found, cannot initialize the Mixed Reality Toolkit"); + Debug.LogError("No Mixed Reality Root Profile found, cannot initialize the Mixed Reality Toolkit"); isInitializing = false; return; } @@ -496,7 +496,7 @@ private void InitializeServiceLocator() { if (CreateAndRegisterService(configuration)) { - switch (configuration.ConfigurationProfile) + switch (configuration.Profile) { case null: // Nothing @@ -505,7 +505,7 @@ private void InitializeServiceLocator() RegisterServices(extensionServiceProfile.RegisteredServiceConfigurations); break; default: - Debug.LogError($"{configuration.ConfigurationProfile.name} does not derive from {nameof(BaseMixedRealityExtensionServiceProfile)}"); + Debug.LogError($"{configuration.Profile.name} does not derive from {nameof(BaseMixedRealityExtensionServiceProfile)}"); break; } } @@ -813,7 +813,7 @@ public static bool CreateAndRegisterService(IMixedRealityServiceConfiguration configuration.RuntimePlatforms, configuration.Name, configuration.Priority, - configuration.ConfigurationProfile); + configuration.Profile); } /// From f747bf3cd35c9d7dc262217a4e9bf25eb2774e75 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 11:53:58 -0400 Subject: [PATCH 04/14] updated docs some more --- .../Definitions/MixedRealityServiceConfiguration.cs | 2 +- .../Interfaces/IMixedRealityServiceConfiguration.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs b/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs index a99939649..072d3e8a3 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Definitions/MixedRealityServiceConfiguration.cs @@ -36,7 +36,7 @@ public class MixedRealityServiceConfiguration : IMixedRealityServiceConfiguratio /// The simple, human readable name for the . /// The priority this will be initialized in. /// runtimePlatform">The runtime platform(s) to run this to run on. - /// The configuration profile for . + /// The for . public MixedRealityServiceConfiguration(SystemType instancedType, string name, uint priority, IReadOnlyList runtimePlatforms, BaseMixedRealityProfile profile) { this.instancedType = instancedType; diff --git a/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs b/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs index 865c52c19..46250456d 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Interfaces/IMixedRealityServiceConfiguration.cs @@ -49,7 +49,7 @@ public interface IMixedRealityServiceConfiguration IReadOnlyList RuntimePlatforms { get; } /// - /// The profile settings for the . + /// The for . /// BaseMixedRealityProfile Profile { get; } } From cdc233b2bc9b454cec6e3f4925f0167b6fdb8bf8 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 12:00:13 -0400 Subject: [PATCH 05/14] updated camera profile inspector --- .../MixedRealityCameraProfileInspector.cs | 68 +++++++++---------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs index d9af08e4e..415b55eae 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; @@ -13,14 +13,14 @@ namespace XRTK.Inspectors.Profiles public class MixedRealityCameraProfileInspector : BaseMixedRealityProfileInspector { private SerializedProperty isCameraPersistent; - private SerializedProperty opaqueNearClip; - private SerializedProperty opaqueClearFlags; - private SerializedProperty opaqueBackgroundColor; + private SerializedProperty nearClipPlaneOpaqueDisplay; + private SerializedProperty cameraClearFlagsOpaqueDisplay; + private SerializedProperty backgroundColorOpaqueDisplay; private SerializedProperty opaqueQualityLevel; - private SerializedProperty transparentNearClip; - private SerializedProperty transparentClearFlags; - private SerializedProperty transparentBackgroundColor; + private SerializedProperty nearClipPlaneTransparentDisplay; + private SerializedProperty cameraClearFlagsTransparentDisplay; + private SerializedProperty backgroundColorTransparentDisplay; private SerializedProperty transparentQualityLevel; private SerializedProperty cameraRigType; @@ -35,32 +35,26 @@ protected override void OnEnable() { base.OnEnable(); - isCameraPersistent = serializedObject.FindProperty("isCameraPersistent"); - opaqueNearClip = serializedObject.FindProperty("nearClipPlaneOpaqueDisplay"); - opaqueClearFlags = serializedObject.FindProperty("cameraClearFlagsOpaqueDisplay"); - opaqueBackgroundColor = serializedObject.FindProperty("backgroundColorOpaqueDisplay"); - opaqueQualityLevel = serializedObject.FindProperty("opaqueQualityLevel"); - - transparentNearClip = serializedObject.FindProperty("nearClipPlaneTransparentDisplay"); - transparentClearFlags = serializedObject.FindProperty("cameraClearFlagsTransparentDisplay"); - transparentBackgroundColor = serializedObject.FindProperty("backgroundColorTransparentDisplay"); - transparentQualityLevel = serializedObject.FindProperty("transparentQualityLevel"); - - cameraRigType = serializedObject.FindProperty("cameraRigType"); - defaultHeadHeight = serializedObject.FindProperty("defaultHeadHeight"); - bodyAdjustmentAngle = serializedObject.FindProperty("bodyAdjustmentAngle"); - bodyAdjustmentSpeed = serializedObject.FindProperty("bodyAdjustmentSpeed"); + isCameraPersistent = serializedObject.FindProperty(nameof(isCameraPersistent)); + nearClipPlaneOpaqueDisplay = serializedObject.FindProperty(nameof(nearClipPlaneOpaqueDisplay)); + cameraClearFlagsOpaqueDisplay = serializedObject.FindProperty(nameof(cameraClearFlagsOpaqueDisplay)); + backgroundColorOpaqueDisplay = serializedObject.FindProperty(nameof(backgroundColorOpaqueDisplay)); + opaqueQualityLevel = serializedObject.FindProperty(nameof(opaqueQualityLevel)); + + nearClipPlaneTransparentDisplay = serializedObject.FindProperty(nameof(nearClipPlaneTransparentDisplay)); + cameraClearFlagsTransparentDisplay = serializedObject.FindProperty(nameof(cameraClearFlagsTransparentDisplay)); + backgroundColorTransparentDisplay = serializedObject.FindProperty(nameof(backgroundColorTransparentDisplay)); + transparentQualityLevel = serializedObject.FindProperty(nameof(transparentQualityLevel)); + + cameraRigType = serializedObject.FindProperty(nameof(cameraRigType)); + defaultHeadHeight = serializedObject.FindProperty(nameof(defaultHeadHeight)); + bodyAdjustmentAngle = serializedObject.FindProperty(nameof(bodyAdjustmentAngle)); + bodyAdjustmentSpeed = serializedObject.FindProperty(nameof(bodyAdjustmentSpeed)); } public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); - - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Configuration Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } + RenderHeader(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Camera Profile", EditorStyles.boldLabel); @@ -82,24 +76,24 @@ public override void OnInspectorGUI() EditorGUILayout.Space(); EditorGUILayout.LabelField("Opaque Display Settings:", EditorStyles.boldLabel); - EditorGUILayout.PropertyField(opaqueNearClip, nearClipTitle); - EditorGUILayout.PropertyField(opaqueClearFlags, clearFlagsTitle); + EditorGUILayout.PropertyField(nearClipPlaneOpaqueDisplay, nearClipTitle); + EditorGUILayout.PropertyField(cameraClearFlagsOpaqueDisplay, clearFlagsTitle); - if ((CameraClearFlags)opaqueClearFlags.intValue == CameraClearFlags.Color) + if ((CameraClearFlags)cameraClearFlagsOpaqueDisplay.intValue == CameraClearFlags.Color) { - opaqueBackgroundColor.colorValue = EditorGUILayout.ColorField("Background Color", opaqueBackgroundColor.colorValue); + backgroundColorOpaqueDisplay.colorValue = EditorGUILayout.ColorField("Background Color", backgroundColorOpaqueDisplay.colorValue); } opaqueQualityLevel.intValue = EditorGUILayout.Popup("Quality Setting", opaqueQualityLevel.intValue, QualitySettings.names); EditorGUILayout.Space(); EditorGUILayout.LabelField("Transparent Display Settings:", EditorStyles.boldLabel); - EditorGUILayout.PropertyField(transparentNearClip, nearClipTitle); - EditorGUILayout.PropertyField(transparentClearFlags, clearFlagsTitle); + EditorGUILayout.PropertyField(nearClipPlaneTransparentDisplay, nearClipTitle); + EditorGUILayout.PropertyField(cameraClearFlagsTransparentDisplay, clearFlagsTitle); - if ((CameraClearFlags)transparentClearFlags.intValue == CameraClearFlags.Color) + if ((CameraClearFlags)cameraClearFlagsTransparentDisplay.intValue == CameraClearFlags.Color) { - transparentBackgroundColor.colorValue = EditorGUILayout.ColorField("Background Color", transparentBackgroundColor.colorValue); + backgroundColorTransparentDisplay.colorValue = EditorGUILayout.ColorField("Background Color", backgroundColorTransparentDisplay.colorValue); } transparentQualityLevel.intValue = EditorGUILayout.Popup("Quality Setting", transparentQualityLevel.intValue, QualitySettings.names); From d94bd39581224507a707d44c64e5b43de751a270 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 12:01:58 -0400 Subject: [PATCH 06/14] updated pointer profile inspector --- .../MixedRealityPointerProfileInspector.cs | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityPointerProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityPointerProfileInspector.cs index b9c5bafe7..945a4122d 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityPointerProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityPointerProfileInspector.cs @@ -30,13 +30,13 @@ protected override void OnEnable() { base.OnEnable(); - pointingExtent = serializedObject.FindProperty("pointingExtent"); - pointingRaycastLayerMasks = serializedObject.FindProperty("pointingRaycastLayerMasks"); - debugDrawPointingRays = serializedObject.FindProperty("debugDrawPointingRays"); - debugDrawPointingRayColors = serializedObject.FindProperty("debugDrawPointingRayColors"); - gazeCursorPrefab = serializedObject.FindProperty("gazeCursorPrefab"); - gazeProviderType = serializedObject.FindProperty("gazeProviderType"); - pointerOptions = serializedObject.FindProperty("pointerOptions"); + pointingExtent = serializedObject.FindProperty(nameof(pointingExtent)); + pointingRaycastLayerMasks = serializedObject.FindProperty(nameof(pointingRaycastLayerMasks)); + debugDrawPointingRays = serializedObject.FindProperty(nameof(debugDrawPointingRays)); + debugDrawPointingRayColors = serializedObject.FindProperty(nameof(debugDrawPointingRayColors)); + gazeCursorPrefab = serializedObject.FindProperty(nameof(gazeCursorPrefab)); + gazeProviderType = serializedObject.FindProperty(nameof(gazeProviderType)); + pointerOptions = serializedObject.FindProperty(nameof(pointerOptions)); pointerOptionList = new ReorderableList(serializedObject, pointerOptions, false, false, true, true) { @@ -50,13 +50,7 @@ protected override void OnEnable() public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); - - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Input Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } + RenderHeader(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Pointer Options", EditorStyles.boldLabel); From b04a94a0e57a2edc284ed0fe3f67a9acee0ba654 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 12:04:27 -0400 Subject: [PATCH 07/14] Updated service provider profile inspector --- .../Profiles/MixedRealityServiceProviderProfileInspector.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 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 7c11ba767..093e20a08 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs @@ -17,7 +17,7 @@ namespace XRTK.Inspectors.Profiles [CustomEditor(typeof(BaseMixedRealityServiceProfile<>))] public class MixedRealityServiceProfileInspector : BaseMixedRealityProfileInspector { - private readonly GUIContent ProfileContent = new GUIContent("Profile", "The configuration profile for this service."); + private readonly GUIContent ProfileContent = new GUIContent("Profile", "The settings profile for this service."); private ReorderableList configurationList; private int currentlySelectedConfigurationOption; @@ -40,7 +40,7 @@ protected override void OnEnable() var baseType = ThisProfile.GetType().BaseType; var genericTypeArgs = baseType?.FindTopmostGenericTypeArguments(); Debug.Assert(genericTypeArgs != null); - ServiceConstraint = genericTypeArgs?[0]; + ServiceConstraint = genericTypeArgs[0]; Debug.Assert(ServiceConstraint != null); configurationList = new ReorderableList(serializedObject, configurations, true, false, true, true) @@ -60,7 +60,7 @@ public override void OnInspectorGUI() if (configurations == null || configurations.arraySize == 0) { - EditorGUILayout.HelpBox($"Register a new Configuration", MessageType.Warning); + EditorGUILayout.HelpBox("Register a new Service Configuration", MessageType.Warning); } serializedObject.ApplyModifiedProperties(); From 6ac95c801884a04122cba67b9e6de83b2a045682 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 12:05:47 -0400 Subject: [PATCH 08/14] fixed configuration profile serialized field reference --- .../Profiles/MixedRealityServiceProviderProfileInspector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 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 093e20a08..275617d3c 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs @@ -99,7 +99,7 @@ private void DrawConfigurationOptionElement(Rect rect, int index, bool isActive, var priorityProperty = configurationProperty.FindPropertyRelative("priority"); var instanceTypeProperty = configurationProperty.FindPropertyRelative("instancedType"); var platformEntriesProperty = configurationProperty.FindPropertyRelative("platformEntries"); - var configurationProfileProperty = configurationProperty.FindPropertyRelative("configurationProfile"); + var configurationProfileProperty = configurationProperty.FindPropertyRelative("profile"); var configurationProfile = configurationProfileProperty.objectReferenceValue as BaseMixedRealityProfile; @@ -237,7 +237,7 @@ private void OnConfigurationOptionAdded(ReorderableList list) var priorityProperty = configuration.FindPropertyRelative("priority"); var instancedTypeProperty = configuration.FindPropertyRelative("instancedType"); var platformEntriesProperty = configuration.FindPropertyRelative("platformEntries"); - var configurationProfileProperty = configuration.FindPropertyRelative("configurationProfile"); + var configurationProfileProperty = configuration.FindPropertyRelative("profile"); var runtimePlatformsProperty = platformEntriesProperty.FindPropertyRelative("runtimePlatforms"); nameProperty.stringValue = $"New Configuration {index}"; From 108f256915f5cf68721bc23cd68a65d2c18013aa Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 12:08:03 -0400 Subject: [PATCH 09/14] updated gesture profile inspector --- .../MixedRealityGesturesProfileInspector.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityGesturesProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityGesturesProfileInspector.cs index 57dff879d..f2806094e 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityGesturesProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityGesturesProfileInspector.cs @@ -35,7 +35,7 @@ protected override void OnEnable() { base.OnEnable(); - gestures = serializedObject.FindProperty("gestures"); + gestures = serializedObject.FindProperty(nameof(gestures)); gesturesProfile = target as MixedRealityGesturesProfile; Debug.Assert(gesturesProfile != null); @@ -79,13 +79,7 @@ private void UpdateGestureLabels() public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); - - if (inputSystemProfile != null && - GUILayout.Button("Back to Input Profile")) - { - Selection.activeObject = inputSystemProfile; - } + RenderHeader(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Gesture Input", EditorStyles.boldLabel); From af77c2bba9909b15a87d5a775da54a4c6d192319 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 12:09:42 -0400 Subject: [PATCH 10/14] updated input system profile inspector --- ...MixedRealityInputSystemProfileInspector.cs | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs index b0994f896..9fabb90a7 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; -using UnityEngine; using XRTK.Definitions.InputSystem; using XRTK.Inspectors.Utilities; using XRTK.Services; @@ -26,26 +25,20 @@ protected override void OnEnable() { base.OnEnable(); - focusProviderType = serializedObject.FindProperty("focusProviderType"); - inputActionsProfile = serializedObject.FindProperty("inputActionsProfile"); - inputActionRulesProfile = serializedObject.FindProperty("inputActionRulesProfile"); - pointerProfile = serializedObject.FindProperty("pointerProfile"); - gesturesProfile = serializedObject.FindProperty("gesturesProfile"); - speechCommandsProfile = serializedObject.FindProperty("speechCommandsProfile"); - controllerVisualizationProfile = serializedObject.FindProperty("controllerVisualizationProfile"); - controllerDataProvidersProfile = serializedObject.FindProperty("controllerDataProvidersProfile"); - controllerMappingProfiles = serializedObject.FindProperty("controllerMappingProfiles"); + focusProviderType = serializedObject.FindProperty(nameof(focusProviderType)); + inputActionsProfile = serializedObject.FindProperty(nameof(inputActionsProfile)); + inputActionRulesProfile = serializedObject.FindProperty(nameof(inputActionRulesProfile)); + pointerProfile = serializedObject.FindProperty(nameof(pointerProfile)); + gesturesProfile = serializedObject.FindProperty(nameof(gesturesProfile)); + speechCommandsProfile = serializedObject.FindProperty(nameof(speechCommandsProfile)); + controllerVisualizationProfile = serializedObject.FindProperty(nameof(controllerVisualizationProfile)); + controllerDataProvidersProfile = serializedObject.FindProperty(nameof(controllerDataProvidersProfile)); + controllerMappingProfiles = serializedObject.FindProperty(nameof(controllerMappingProfiles)); } public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); - - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Configuration Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } + RenderHeader(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Input System Profile", EditorStyles.boldLabel); From 1ca040941b9c2fcefe42b44e0fca6b07c479b391 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 12:42:05 -0400 Subject: [PATCH 11/14] Updated all the inspectors with nameof usages Updated all the inspectors to use RenderHeader where appropriate --- Submodules/WindowsMixedReality | 2 +- .../BaseMixedRealityProfileInspector.cs | 2 + ...ealityDiagnosticsSystemProfileInspector.cs | 18 ++----- ...ealityControllerMappingProfileInspector.cs | 13 ++--- ...ControllerDataProvidersProfileInspector.cs | 15 +----- ...alityControllerMappingProfilesInspector.cs | 14 ++---- ...ControllerVisualizationProfileInspector.cs | 27 ++++------ .../MixedRealityGesturesProfileInspector.cs | 5 +- ...ixedRealityInputActionsProfileInspector.cs | 21 ++------ ...MixedRealityInputSystemProfileInspector.cs | 5 +- .../MixedRealityPointerProfileInspector.cs | 3 +- ...edRealitySpeechCommandsProfileInspector.cs | 25 ++++------ ...tyBoundaryVisualizationProfileInspector.cs | 49 ++++++++----------- .../MixedRealityCameraProfileInspector.cs | 2 - ...xedRealityNetworkSystemProfileInspector.cs | 18 ++----- ...isteredServiceProvidersProfileInspector.cs | 15 +----- ...dRealityServiceProviderProfileInspector.cs | 1 + ...ixedRealityToolkitRootProfileInspector.cs} | 2 +- ...ealityToolkitRootProfileInspector.cs.meta} | 0 ...litySpatialMeshObserverProfileInspector.cs | 18 +++---- ...dRealitySpatialObserverProfileInspector.cs | 23 +++------ ...dRealitySurfaceObserverProfileInspector.cs | 22 ++++----- ...ySpatialAwarenessSystemProfileInspector.cs | 17 ++----- 23 files changed, 105 insertions(+), 212 deletions(-) rename XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/{MixedRealityToolkitSettingsProfileInspector.cs => MixedRealityToolkitRootProfileInspector.cs} (99%) rename XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/{MixedRealityToolkitSettingsProfileInspector.cs.meta => MixedRealityToolkitRootProfileInspector.cs.meta} (100%) diff --git a/Submodules/WindowsMixedReality b/Submodules/WindowsMixedReality index 50c4e1ae8..8988de187 160000 --- a/Submodules/WindowsMixedReality +++ b/Submodules/WindowsMixedReality @@ -1 +1 @@ -Subproject commit 50c4e1ae8ccaa170de5a7225d24365f218d140bb +Subproject commit 8988de1875368f9b783e9c4779c9b608aa47b87d diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs index 30eb3b089..f168fb479 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs @@ -45,6 +45,8 @@ protected void RenderHeader() { Selection.activeObject = ThisProfile.ParentProfile; } + + EditorGUILayout.Space(); } /// diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/DiagnosticsSystem/MixedRealityDiagnosticsSystemProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/DiagnosticsSystem/MixedRealityDiagnosticsSystemProfileInspector.cs index 6c7104627..800e23321 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/DiagnosticsSystem/MixedRealityDiagnosticsSystemProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/DiagnosticsSystem/MixedRealityDiagnosticsSystemProfileInspector.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; -using UnityEngine; using XRTK.Definitions.DiagnosticsSystem; using XRTK.Inspectors.Utilities; @@ -24,25 +23,18 @@ protected override void OnEnable() public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Configuration Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } - - ThisProfile.CheckProfileLock(); - serializedObject.Update(); - - EditorGUILayout.Space(); EditorGUILayout.LabelField("Diagnostic System Profile", EditorStyles.boldLabel); EditorGUILayout.HelpBox("Diagnostic can help monitor system resources and performance inside an application during development.", MessageType.Info); EditorGUILayout.Space(); + + ThisProfile.CheckProfileLock(); + serializedObject.Update(); EditorGUILayout.PropertyField(diagnosticsWindowPrefab); EditorGUILayout.PropertyField(showDiagnosticsWindowOnStart); - EditorGUILayout.Space(); serializedObject.ApplyModifiedProperties(); + base.OnInspectorGUI(); } } diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/Controllers/BaseMixedRealityControllerMappingProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/Controllers/BaseMixedRealityControllerMappingProfileInspector.cs index f818cce71..d498717ab 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/Controllers/BaseMixedRealityControllerMappingProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/Controllers/BaseMixedRealityControllerMappingProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Collections.Generic; @@ -40,21 +40,14 @@ protected override void OnEnable() { base.OnEnable(); - controllerMappings = serializedObject.FindProperty("controllerMappings"); + controllerMappings = serializedObject.FindProperty(nameof(controllerMappings)); controllerMappingProfile = target as BaseMixedRealityControllerMappingProfile; } public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to controller mapping list")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } - - EditorGUILayout.Space(); var deviceName = controllerMappingProfile.ControllerType == SupportedControllerType.None ? "Custom Device" : controllerMappingProfile.ControllerType.ToString(); EditorGUILayout.LabelField($"{deviceName} Mappings", EditorStyles.boldLabel); diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerDataProvidersProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerDataProvidersProfileInspector.cs index d8a58e08d..ae404351d 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerDataProvidersProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerDataProvidersProfileInspector.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; -using UnityEngine; using XRTK.Inspectors.Utilities; using XRTK.Definitions.Controllers; @@ -13,24 +12,14 @@ public class MixedRealityControllerDataProvidersProfileInspector : MixedRealityS { public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Input Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } - - EditorGUILayout.Space(); EditorGUILayout.LabelField("Controller Data Providers", EditorStyles.boldLabel); EditorGUILayout.HelpBox("Use this profile to define all the input sources your application can get input data from.", MessageType.Info); ThisProfile.CheckProfileLock(); - serializedObject.Update(); - EditorGUILayout.Space(); + base.OnInspectorGUI(); - EditorGUILayout.Space(); - serializedObject.ApplyModifiedProperties(); } } } \ No newline at end of file diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerMappingProfilesInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerMappingProfilesInspector.cs index f64a29530..949189b40 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerMappingProfilesInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerMappingProfilesInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Collections.Generic; @@ -23,26 +23,18 @@ protected override void OnEnable() { base.OnEnable(); - controllerMappingProfiles = serializedObject.FindProperty("controllerMappingProfiles"); + controllerMappingProfiles = serializedObject.FindProperty(nameof(controllerMappingProfiles)); } public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Input Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } - - EditorGUILayout.Space(); EditorGUILayout.LabelField("Controller Input Mappings", EditorStyles.boldLabel); EditorGUILayout.HelpBox("Use this profile to define all the controllers and their inputs your users will be able to use in your application.\n\n" + "You'll want to define all your Input Actions and Controller Data Providers first so you can wire up actions to hardware sensors, controllers, gestures, and other input devices.", MessageType.Info); ThisProfile.CheckProfileLock(); - serializedObject.Update(); EditorGUILayout.Space(); diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerVisualizationProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerVisualizationProfileInspector.cs index 4c88dad83..7e83fa1ef 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerVisualizationProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityControllerVisualizationProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; @@ -47,26 +47,19 @@ protected override void OnEnable() controllerVisualizationProfile = target as MixedRealityControllerVisualizationProfile; - renderMotionControllers = serializedObject.FindProperty("renderMotionControllers"); - controllerVisualizationType = serializedObject.FindProperty("controllerVisualizationType"); - useDefaultModels = serializedObject.FindProperty("useDefaultModels"); - globalLeftHandModel = serializedObject.FindProperty("globalLeftHandModel"); - globalRightHandModel = serializedObject.FindProperty("globalRightHandModel"); - globalPointerPose = serializedObject.FindProperty("globalPointerPose"); - controllerVisualizationSettings = serializedObject.FindProperty("controllerVisualizationSettings"); + renderMotionControllers = serializedObject.FindProperty(nameof(renderMotionControllers)); + controllerVisualizationType = serializedObject.FindProperty(nameof(controllerVisualizationType)); + useDefaultModels = serializedObject.FindProperty(nameof(useDefaultModels)); + globalLeftHandModel = serializedObject.FindProperty(nameof(globalLeftHandModel)); + globalRightHandModel = serializedObject.FindProperty(nameof(globalRightHandModel)); + globalPointerPose = serializedObject.FindProperty(nameof(globalPointerPose)); + controllerVisualizationSettings = serializedObject.FindProperty(nameof(controllerVisualizationSettings)); } public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Input Profile")) - { - Selection.activeObject = controllerVisualizationProfile.ParentProfile; - } - - EditorGUILayout.Space(); EditorGUILayout.LabelField("Controller Visualizations", EditorStyles.boldLabel); EditorGUILayout.HelpBox("Define all the custom controller visualizations you'd like to use for each controller type when they're rendered in the scene.\n\n" + "Global settings are the default fallback, and any specific controller definitions take precedence.", MessageType.Info); @@ -188,7 +181,7 @@ private void RenderControllerList(SerializedProperty controllerList) } var handednessValue = mixedRealityControllerHandedness.intValue - 1; - + // Reset in case it was set to something other than left, right or both. if (handednessValue < 0 || handednessValue > 2) { handednessValue = 0; } diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityGesturesProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityGesturesProfileInspector.cs index f2806094e..3d674908a 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityGesturesProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityGesturesProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; @@ -81,7 +81,6 @@ public override void OnInspectorGUI() { RenderHeader(); - EditorGUILayout.Space(); EditorGUILayout.LabelField("Gesture Input", EditorStyles.boldLabel); EditorGUILayout.HelpBox("This gesture map is any and all movements of part the user's body, especially a hand or the head, that raise actions through the input system.\n\nNote: Defined controllers can look up the list of gestures and raise the events based on specific criteria.", MessageType.Info); @@ -98,8 +97,8 @@ public override void OnInspectorGUI() } gesturesProfile.CheckProfileLock(); - serializedObject.Update(); + EditorGUILayout.Space(); EditorGUILayout.LabelField("Defined Recognizable Gestures", EditorStyles.boldLabel); RenderList(gestures); diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputActionsProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputActionsProfileInspector.cs index 76cc803da..cc41d7152 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputActionsProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputActionsProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; @@ -18,37 +18,26 @@ public class MixedRealityInputActionsProfileInspector : BaseMixedRealityProfileI private static Vector2 scrollPosition = Vector2.zero; - private SerializedProperty inputActionList; + private SerializedProperty inputActions; protected override void OnEnable() { base.OnEnable(); - inputActionList = serializedObject.FindProperty("inputActions"); + inputActions = serializedObject.FindProperty(nameof(inputActions)); } public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Input Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } - - ThisProfile.CheckProfileLock(); - - EditorGUILayout.Space(); EditorGUILayout.LabelField("Input Actions", EditorStyles.boldLabel); - EditorGUILayout.HelpBox("Input Actions are any/all actions your users will be able to make when interacting with your application.\n\n" + "After defining all your actions, you can then wire up these actions to hardware sensors, controllers, and other input devices.", MessageType.Info); ThisProfile.CheckProfileLock(); - serializedObject.Update(); - RenderList(inputActionList); + RenderList(inputActions); serializedObject.ApplyModifiedProperties(); } diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs index 9fabb90a7..e29bdf4a3 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityInputSystemProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; @@ -40,13 +40,12 @@ public override void OnInspectorGUI() { RenderHeader(); - EditorGUILayout.Space(); EditorGUILayout.LabelField("Input System Profile", EditorStyles.boldLabel); EditorGUILayout.HelpBox("The Input System Profile helps developers configure input no matter what platform you're building for.", MessageType.Info); ThisProfile.CheckProfileLock(); - serializedObject.Update(); + bool changed = false; EditorGUI.BeginChangeCheck(); diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityPointerProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityPointerProfileInspector.cs index 945a4122d..ae39ac940 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityPointerProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealityPointerProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; @@ -52,7 +52,6 @@ public override void OnInspectorGUI() { RenderHeader(); - EditorGUILayout.Space(); EditorGUILayout.LabelField("Pointer Options", EditorStyles.boldLabel); EditorGUILayout.HelpBox("Pointers attach themselves onto controllers as they are initialized.", MessageType.Info); EditorGUILayout.Space(); diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealitySpeechCommandsProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealitySpeechCommandsProfileInspector.cs index f66c41adf..2d83663d4 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealitySpeechCommandsProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/InputSystem/MixedRealitySpeechCommandsProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Linq; @@ -18,7 +18,7 @@ public class MixedRealitySpeechCommandsProfileInspector : BaseMixedRealityProfil private static readonly GUIContent KeyCodeContent = new GUIContent("KeyCode", "The keyboard key that will trigger the action."); private static readonly GUIContent ActionContent = new GUIContent("Action", "The action to trigger when a keyboard key is pressed or keyword is recognized."); - private SerializedProperty recognizerStartBehaviour; + private SerializedProperty startBehavior; private SerializedProperty recognitionConfidenceLevel; private SerializedProperty speechCommands; private static GUIContent[] actionLabels; @@ -34,26 +34,17 @@ protected override void OnEnable() if (inputSystemProfile == null || inputSystemProfile.InputActionsProfile == null) { return; } - recognizerStartBehaviour = serializedObject.FindProperty("startBehavior"); - recognitionConfidenceLevel = serializedObject.FindProperty("recognitionConfidenceLevel"); - speechCommands = serializedObject.FindProperty("speechCommands"); + startBehavior = serializedObject.FindProperty(nameof(startBehavior)); + recognitionConfidenceLevel = serializedObject.FindProperty(nameof(recognitionConfidenceLevel)); + speechCommands = serializedObject.FindProperty(nameof(speechCommands)); actionLabels = inputSystemProfile.InputActionsProfile.InputActions.Select(action => new GUIContent(action.Description)).Prepend(new GUIContent("None")).ToArray(); actionIds = inputSystemProfile.InputActionsProfile.InputActions.Select(action => (int)action.Id).Prepend(0).ToArray(); } public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (inputSystemProfile != null && - GUILayout.Button("Back to Input Profile")) - { - Selection.activeObject = inputSystemProfile; - } - - ThisProfile.CheckProfileLock(); - - EditorGUILayout.Space(); EditorGUILayout.LabelField("Speech Commands", EditorStyles.boldLabel); EditorGUILayout.HelpBox("Speech Commands are any/all spoken keywords your users will be able say to raise an Input Action in your application.", MessageType.Info); EditorGUILayout.Space(); @@ -70,9 +61,11 @@ public override void OnInspectorGUI() return; } + + ThisProfile.CheckProfileLock(); serializedObject.Update(); - EditorGUILayout.PropertyField(recognizerStartBehaviour); + EditorGUILayout.PropertyField(startBehavior); EditorGUILayout.PropertyField(recognitionConfidenceLevel); RenderList(speechCommands); diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityBoundaryVisualizationProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityBoundaryVisualizationProfileInspector.cs index 26430e2c3..150cd928c 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityBoundaryVisualizationProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityBoundaryVisualizationProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; @@ -42,48 +42,41 @@ protected override void OnEnable() { base.OnEnable(); - boundaryHeight = serializedObject.FindProperty("boundaryHeight"); + boundaryHeight = serializedObject.FindProperty(nameof(boundaryHeight)); - showFloor = serializedObject.FindProperty("showFloor"); - floorMaterial = serializedObject.FindProperty("floorMaterial"); - floorScale = serializedObject.FindProperty("floorScale"); - floorPhysicsLayer = serializedObject.FindProperty("floorPhysicsLayer"); + showFloor = serializedObject.FindProperty(nameof(showFloor)); + floorMaterial = serializedObject.FindProperty(nameof(floorMaterial)); + floorScale = serializedObject.FindProperty(nameof(floorScale)); + floorPhysicsLayer = serializedObject.FindProperty(nameof(floorPhysicsLayer)); - showPlayArea = serializedObject.FindProperty("showPlayArea"); - playAreaMaterial = serializedObject.FindProperty("playAreaMaterial"); - playAreaPhysicsLayer = serializedObject.FindProperty("playAreaPhysicsLayer"); + showPlayArea = serializedObject.FindProperty(nameof(showPlayArea)); + playAreaMaterial = serializedObject.FindProperty(nameof(playAreaMaterial)); + playAreaPhysicsLayer = serializedObject.FindProperty(nameof(playAreaPhysicsLayer)); - showTrackedArea = serializedObject.FindProperty("showTrackedArea"); - trackedAreaMaterial = serializedObject.FindProperty("trackedAreaMaterial"); - trackedAreaPhysicsLayer = serializedObject.FindProperty("trackedAreaPhysicsLayer"); + showTrackedArea = serializedObject.FindProperty(nameof(showTrackedArea)); + trackedAreaMaterial = serializedObject.FindProperty(nameof(trackedAreaMaterial)); + trackedAreaPhysicsLayer = serializedObject.FindProperty(nameof(trackedAreaPhysicsLayer)); - showBoundaryWalls = serializedObject.FindProperty("showBoundaryWalls"); - boundaryWallMaterial = serializedObject.FindProperty("boundaryWallMaterial"); - boundaryWallsPhysicsLayer = serializedObject.FindProperty("boundaryWallsPhysicsLayer"); + showBoundaryWalls = serializedObject.FindProperty(nameof(showBoundaryWalls)); + boundaryWallMaterial = serializedObject.FindProperty(nameof(boundaryWallMaterial)); + boundaryWallsPhysicsLayer = serializedObject.FindProperty(nameof(boundaryWallsPhysicsLayer)); - showBoundaryCeiling = serializedObject.FindProperty("showBoundaryCeiling"); - boundaryCeilingMaterial = serializedObject.FindProperty("boundaryCeilingMaterial"); - ceilingPhysicsLayer = serializedObject.FindProperty("ceilingPhysicsLayer"); + showBoundaryCeiling = serializedObject.FindProperty(nameof(showBoundaryCeiling)); + boundaryCeilingMaterial = serializedObject.FindProperty(nameof(boundaryCeilingMaterial)); + ceilingPhysicsLayer = serializedObject.FindProperty(nameof(ceilingPhysicsLayer)); } public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Configuration Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } - - EditorGUILayout.Space(); EditorGUILayout.LabelField("Boundary Visualization Options", EditorStyles.boldLabel); EditorGUILayout.HelpBox("Boundary visualizations can help users stay oriented and comfortable in the experience.", MessageType.Info); EditorGUILayout.Space(); - (target as BaseMixedRealityProfile).CheckProfileLock(); - + ThisProfile.CheckProfileLock(); serializedObject.Update(); + EditorGUILayout.PropertyField(boundaryHeight); EditorGUILayout.Space(); EditorGUILayout.LabelField("Floor Settings:", EditorStyles.boldLabel); diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs index 415b55eae..facfb8c54 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityCameraProfileInspector.cs @@ -56,12 +56,10 @@ public override void OnInspectorGUI() { RenderHeader(); - EditorGUILayout.Space(); EditorGUILayout.LabelField("Camera Profile", EditorStyles.boldLabel); EditorGUILayout.HelpBox("The Camera Profile helps tweak camera settings no matter what platform you're building for.", MessageType.Info); ThisProfile.CheckProfileLock(); - serializedObject.Update(); EditorGUI.BeginChangeCheck(); diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityNetworkSystemProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityNetworkSystemProfileInspector.cs index 0aa9e0326..e47c5fd2d 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityNetworkSystemProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityNetworkSystemProfileInspector.cs @@ -1,8 +1,7 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; -using UnityEngine; using XRTK.Definitions.NetworkingSystem; using XRTK.Inspectors.Utilities; @@ -13,24 +12,15 @@ public class MixedRealityNetworkSystemProfileInspector : MixedRealityServiceProf { public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Configuration Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } - - EditorGUILayout.Space(); EditorGUILayout.LabelField("Network System Profile", EditorStyles.boldLabel); EditorGUILayout.HelpBox("The Network System Profile helps developers configure networking messages no matter what platform you're building for.", MessageType.Info); + EditorGUILayout.Space(); ThisProfile.CheckProfileLock(); - serializedObject.Update(); - EditorGUILayout.Space(); + base.OnInspectorGUI(); - EditorGUILayout.Space(); - serializedObject.ApplyModifiedProperties(); } } } \ No newline at end of file diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityRegisteredServiceProvidersProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityRegisteredServiceProvidersProfileInspector.cs index 5bbab41d1..9d06313ac 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityRegisteredServiceProvidersProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityRegisteredServiceProvidersProfileInspector.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; -using UnityEngine; using XRTK.Definitions; using XRTK.Inspectors.Utilities; @@ -13,25 +12,15 @@ public class MixedRealityRegisteredServiceProvidersProfileInspector : MixedReali { public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Configuration Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } - - EditorGUILayout.Space(); EditorGUILayout.LabelField("Registered Service Providers Profile", EditorStyles.boldLabel); EditorGUILayout.HelpBox("This profile defines any additional Services like systems, features, and managers to register with the Mixed Reality Toolkit.\n\n" + "Note: The order of the list determines the order these services get created.", MessageType.Info); ThisProfile.CheckProfileLock(); - serializedObject.Update(); - EditorGUILayout.Space(); + base.OnInspectorGUI(); - EditorGUILayout.Space(); - serializedObject.ApplyModifiedProperties(); } } } \ No newline at end of file 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 275617d3c..50ebd9968 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityServiceProviderProfileInspector.cs @@ -55,6 +55,7 @@ protected override void OnEnable() public override void OnInspectorGUI() { + EditorGUILayout.Space(); serializedObject.Update(); configurationList.DoLayoutList(); diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitRootProfileInspector.cs similarity index 99% rename from XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs rename to XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitRootProfileInspector.cs index bc3784611..de82cc8ac 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitRootProfileInspector.cs @@ -12,7 +12,7 @@ namespace XRTK.Inspectors.Profiles { [CustomEditor(typeof(MixedRealityToolkitRootProfile))] - public class MixedRealityToolkitSettingsProfileInspector : BaseMixedRealityProfileInspector + public class MixedRealityToolkitRootProfileInspector : BaseMixedRealityProfileInspector { // Camera system properties private SerializedProperty enableCameraSystem; diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs.meta b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitRootProfileInspector.cs.meta similarity index 100% rename from XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitSettingsProfileInspector.cs.meta rename to XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityToolkitRootProfileInspector.cs.meta diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySpatialMeshObserverProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySpatialMeshObserverProfileInspector.cs index 86e57a07e..089b27ba4 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySpatialMeshObserverProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySpatialMeshObserverProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; @@ -25,14 +25,14 @@ protected override void OnEnable() { base.OnEnable(); - meshPhysicsLayerOverride = serializedObject.FindProperty("meshPhysicsLayerOverride"); - meshLevelOfDetail = serializedObject.FindProperty("meshLevelOfDetail"); - meshTrianglesPerCubicMeter = serializedObject.FindProperty("meshTrianglesPerCubicMeter"); - meshRecalculateNormals = serializedObject.FindProperty("meshRecalculateNormals"); - meshVisibleMaterial = serializedObject.FindProperty("meshVisibleMaterial"); - meshOcclusionMaterial = serializedObject.FindProperty("meshOcclusionMaterial"); - additionalComponents = serializedObject.FindProperty("additionalComponents"); - meshObjectPrefab = serializedObject.FindProperty("meshObjectPrefab"); + meshPhysicsLayerOverride = serializedObject.FindProperty(nameof(meshPhysicsLayerOverride)); + meshLevelOfDetail = serializedObject.FindProperty(nameof(meshLevelOfDetail)); + meshTrianglesPerCubicMeter = serializedObject.FindProperty(nameof(meshTrianglesPerCubicMeter)); + meshRecalculateNormals = serializedObject.FindProperty(nameof(meshRecalculateNormals)); + meshVisibleMaterial = serializedObject.FindProperty(nameof(meshVisibleMaterial)); + meshOcclusionMaterial = serializedObject.FindProperty(nameof(meshOcclusionMaterial)); + additionalComponents = serializedObject.FindProperty(nameof(additionalComponents)); + meshObjectPrefab = serializedObject.FindProperty(nameof(meshObjectPrefab)); } /// diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySpatialObserverProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySpatialObserverProfileInspector.cs index 7b93f5a9f..a77158655 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySpatialObserverProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySpatialObserverProfileInspector.cs @@ -1,8 +1,7 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; -using UnityEngine; using XRTK.Inspectors.Utilities; using XRTK.Providers.SpatialObservers; @@ -24,31 +23,23 @@ protected override void OnEnable() { base.OnEnable(); - startupBehavior = serializedObject.FindProperty("startupBehavior"); - observationExtents = serializedObject.FindProperty("observationExtents"); - isStationaryObserver = serializedObject.FindProperty("isStationaryObserver"); - updateInterval = serializedObject.FindProperty("updateInterval"); - physicsLayer = serializedObject.FindProperty("physicsLayer"); + startupBehavior = serializedObject.FindProperty(nameof(startupBehavior)); + observationExtents = serializedObject.FindProperty(nameof(observationExtents)); + isStationaryObserver = serializedObject.FindProperty(nameof(isStationaryObserver)); + updateInterval = serializedObject.FindProperty(nameof(updateInterval)); + physicsLayer = serializedObject.FindProperty(nameof(physicsLayer)); } /// public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Spatial Awareness Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } - - EditorGUILayout.Space(); EditorGUILayout.LabelField("Spatial Observer Options", EditorStyles.boldLabel); EditorGUILayout.HelpBox("The Spatial Awareness Observer Data Provider supplies the Spatial Awareness system with all the data it needs to understand the world around you.", MessageType.Info); EditorGUILayout.Space(); ThisProfile.CheckProfileLock(); - serializedObject.Update(); foldout = EditorGUILayout.Foldout(foldout, "General Settings", true); diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySurfaceObserverProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySurfaceObserverProfileInspector.cs index b59375bfd..2d73c9b88 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySurfaceObserverProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/BaseMixedRealitySurfaceObserverProfileInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; @@ -34,16 +34,16 @@ protected override void OnEnable() { base.OnEnable(); - surfacePhysicsLayerOverride = serializedObject.FindProperty("surfacePhysicsLayerOverride"); - surfaceFindingMinimumArea = serializedObject.FindProperty("surfaceFindingMinimumArea"); - displayFloorSurfaces = serializedObject.FindProperty("displayFloorSurfaces"); - floorSurfaceMaterial = serializedObject.FindProperty("floorSurfaceMaterial"); - displayCeilingSurfaces = serializedObject.FindProperty("displayCeilingSurfaces"); - ceilingSurfaceMaterial = serializedObject.FindProperty("ceilingSurfaceMaterial"); - displayWallSurfaces = serializedObject.FindProperty("displayWallSurfaces"); - wallSurfaceMaterial = serializedObject.FindProperty("wallSurfaceMaterial"); - displayPlatformSurfaces = serializedObject.FindProperty("displayPlatformSurfaces"); - platformSurfaceMaterial = serializedObject.FindProperty("platformSurfaceMaterial"); + surfacePhysicsLayerOverride = serializedObject.FindProperty(nameof(surfacePhysicsLayerOverride)); + surfaceFindingMinimumArea = serializedObject.FindProperty(nameof(surfaceFindingMinimumArea)); + displayFloorSurfaces = serializedObject.FindProperty(nameof(displayFloorSurfaces)); + floorSurfaceMaterial = serializedObject.FindProperty(nameof(floorSurfaceMaterial)); + displayCeilingSurfaces = serializedObject.FindProperty(nameof(displayCeilingSurfaces)); + ceilingSurfaceMaterial = serializedObject.FindProperty(nameof(ceilingSurfaceMaterial)); + displayWallSurfaces = serializedObject.FindProperty(nameof(displayWallSurfaces)); + wallSurfaceMaterial = serializedObject.FindProperty(nameof(wallSurfaceMaterial)); + displayPlatformSurfaces = serializedObject.FindProperty(nameof(displayPlatformSurfaces)); + platformSurfaceMaterial = serializedObject.FindProperty(nameof(platformSurfaceMaterial)); } /// diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/MixedRealitySpatialAwarenessSystemProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/MixedRealitySpatialAwarenessSystemProfileInspector.cs index b4513c852..560b4bc88 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/MixedRealitySpatialAwarenessSystemProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/SpatialAwarenessSystem/MixedRealitySpatialAwarenessSystemProfileInspector.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEditor; -using UnityEngine; using XRTK.Definitions.SpatialAwarenessSystem; using XRTK.Inspectors.Utilities; @@ -24,26 +23,18 @@ protected override void OnEnable() /// public override void OnInspectorGUI() { - MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + RenderHeader(); - if (ThisProfile.ParentProfile != null && - GUILayout.Button("Back to Configuration Profile")) - { - Selection.activeObject = ThisProfile.ParentProfile; - } - - EditorGUILayout.Space(); EditorGUILayout.LabelField("Spatial Awareness System Settings", EditorStyles.boldLabel); EditorGUILayout.HelpBox("Spatial Awareness can enhance your experience by enabling objects to interact with the real world.\n\nBelow is a list of registered Spatial Observers that can gather data about your environment.", MessageType.Info); + EditorGUILayout.Space(); ThisProfile.CheckProfileLock(); serializedObject.Update(); - EditorGUILayout.Space(); EditorGUILayout.PropertyField(meshDisplayOption); - EditorGUILayout.Space(); - base.OnInspectorGUI(); - EditorGUILayout.Space(); serializedObject.ApplyModifiedProperties(); + + base.OnInspectorGUI(); } } } \ No newline at end of file From 949dce013dfb40ac62f367e6e699f64c7f9dae69 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 12:48:23 -0400 Subject: [PATCH 12/14] removed unused using statement --- Submodules/WindowsMixedReality | 2 +- .../MixedRealityBoundaryVisualizationProfileInspector.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Submodules/WindowsMixedReality b/Submodules/WindowsMixedReality index 8988de187..a35dc3db4 160000 --- a/Submodules/WindowsMixedReality +++ b/Submodules/WindowsMixedReality @@ -1 +1 @@ -Subproject commit 8988de1875368f9b783e9c4779c9b608aa47b87d +Subproject commit a35dc3db43590d3b76c1ef8ae464972cd798c2c3 diff --git a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityBoundaryVisualizationProfileInspector.cs b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityBoundaryVisualizationProfileInspector.cs index 150cd928c..a9d87d334 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityBoundaryVisualizationProfileInspector.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Inspectors/Profiles/MixedRealityBoundaryVisualizationProfileInspector.cs @@ -3,7 +3,6 @@ using UnityEditor; using UnityEngine; -using XRTK.Definitions; using XRTK.Definitions.BoundarySystem; using XRTK.Inspectors.Utilities; From 571fab40c09b468df599ca4477a2c9ba1f138898 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 13:02:15 -0400 Subject: [PATCH 13/14] updated sdk checkout --- Submodules/SDK | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodules/SDK b/Submodules/SDK index eedfebb3b..b0d6c2f89 160000 --- a/Submodules/SDK +++ b/Submodules/SDK @@ -1 +1 @@ -Subproject commit eedfebb3b05b0b14caf148f6e98c3409a2a79102 +Subproject commit b0d6c2f8955608b2f31beeed674312d4be54bbef From b37e294dcc58d4e670e6ec003b2f1201fc6cc56b Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 1 Apr 2020 13:57:56 -0400 Subject: [PATCH 14/14] updated wmr checkout --- Submodules/WindowsMixedReality | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodules/WindowsMixedReality b/Submodules/WindowsMixedReality index a35dc3db4..e4836a622 160000 --- a/Submodules/WindowsMixedReality +++ b/Submodules/WindowsMixedReality @@ -1 +1 @@ -Subproject commit a35dc3db43590d3b76c1ef8ae464972cd798c2c3 +Subproject commit e4836a6220cc5518d70b0f982d23a24578d250f3