diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e69de29 diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsDictationDataProvider.cs b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsDictationDataProvider.cs index a8a1821..71f8d29 100644 --- a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsDictationDataProvider.cs +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsDictationDataProvider.cs @@ -25,8 +25,9 @@ public class WindowsDictationDataProvider : BaseDictationDataProvider /// /// /// - - public WindowsDictationDataProvider(string name, uint priority) : base(name, priority) + /// + public WindowsDictationDataProvider(string name, uint priority, BaseMixedRealityControllerDataProviderProfile profile) + : base(name, priority, profile) { #if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN if (dictationRecognizer == null) @@ -176,7 +177,7 @@ public override async Task StartRecordingAsync(GameObject listener = null, float // Query the maximum frequency of the default microphone. deviceName = micDeviceName; - Microphone.GetDeviceCaps(deviceName, out int minSamplingRate, out samplingRate); + Microphone.GetDeviceCaps(deviceName, out var minSamplingRate, out samplingRate); dictationRecognizer.InitialSilenceTimeoutSeconds = initialSilenceTimeout; dictationRecognizer.AutoSilenceTimeoutSeconds = autoSilenceTimeout; diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsMixedRealityDataProvider.cs b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsMixedRealityDataProvider.cs index 7d9cc85..f5f677b 100644 --- a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsMixedRealityDataProvider.cs +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsMixedRealityDataProvider.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using XRTK.Providers.Controllers; +using XRTK.WindowsMixedReality.Profiles; #if UNITY_WSA using System.Collections.Generic; @@ -38,9 +39,12 @@ public class WindowsMixedRealityDataProvider : BaseControllerDataProvider /// /// /// - public WindowsMixedRealityDataProvider(string name, uint priority) : base(name, priority) + /// + public WindowsMixedRealityDataProvider(string name, uint priority, WindowsMixedRealityControllerDataProviderProfile profile) + : base(name, priority, profile) { #if UNITY_WSA + this.profile = profile; gestureRecognizer = new GestureRecognizer(); navigationGestureRecognizer = new GestureRecognizer(); #endif // UNITY_WSA @@ -48,6 +52,8 @@ public WindowsMixedRealityDataProvider(string name, uint priority) : base(name, #if UNITY_WSA + private readonly WindowsMixedRealityControllerDataProviderProfile profile; + /// /// Dictionary to capture all active controllers detected /// @@ -240,10 +246,10 @@ public override void Enable() MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.GesturesProfile != null) { var gestureProfile = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.GesturesProfile; - GestureSettings = gestureProfile.ManipulationGestures; - NavigationSettings = gestureProfile.NavigationGestures; - RailsNavigationSettings = gestureProfile.RailsNavigationGestures; - UseRailsNavigation = gestureProfile.UseRailsNavigation; + GestureSettings = profile.ManipulationGestures; + NavigationSettings = profile.NavigationGestures; + RailsNavigationSettings = profile.RailsNavigationGestures; + UseRailsNavigation = profile.UseRailsNavigation; for (int i = 0; i < gestureProfile.Gestures.Length; i++) { @@ -289,7 +295,7 @@ public override void Enable() if (MixedRealityToolkit.Instance.ActiveProfile.IsInputSystemEnabled && MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.GesturesProfile != null && - MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.GesturesProfile.WindowsGestureAutoStart == AutoStartBehavior.AutoStart) + profile.WindowsGestureAutoStart == AutoStartBehavior.AutoStart) { GestureRecognizerEnabled = true; } diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsSpeechDataProvider.cs b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsSpeechDataProvider.cs index 53bb83a..fa7faa6 100644 --- a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsSpeechDataProvider.cs +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Controllers/WindowsSpeechDataProvider.cs @@ -20,7 +20,8 @@ namespace XRTK.WindowsMixedReality.Controllers /// public class WindowsSpeechDataProvider : BaseSpeechDataProvider { - public WindowsSpeechDataProvider(string name, uint priority) : base(name, priority) + public WindowsSpeechDataProvider(string name, uint priority, BaseMixedRealityControllerDataProviderProfile profile) + : base(name, priority, profile) { if (MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile == null) { diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Inspectors/WindowsMixedRealityDataProviderProfileInspector.cs b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Inspectors/WindowsMixedRealityDataProviderProfileInspector.cs new file mode 100644 index 0000000..86df59a --- /dev/null +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Inspectors/WindowsMixedRealityDataProviderProfileInspector.cs @@ -0,0 +1,67 @@ +// 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; +using XRTK.Inspectors.Profiles; +using XRTK.Inspectors.Utilities; +using XRTK.Services; +using XRTK.WindowsMixedReality.Profiles; + +namespace XRTK.WindowsMixedReality.Inspectors +{ + [CustomEditor(typeof(WindowsMixedRealityControllerDataProviderProfile))] + public class WindowsMixedRealityDataProviderProfileInspector : BaseMixedRealityProfileInspector + { + private SerializedProperty windowsManipulationGestureSettings; + private SerializedProperty useRailsNavigation; + private SerializedProperty windowsNavigationGestureSettings; + private SerializedProperty windowsRailsNavigationGestures; + private SerializedProperty windowsGestureAutoStart; + + protected override void OnEnable() + { + base.OnEnable(); + + if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured(false)) + { + return; + } + + windowsManipulationGestureSettings = serializedObject.FindProperty("manipulationGestures"); + useRailsNavigation = serializedObject.FindProperty("useRailsNavigation"); + windowsNavigationGestureSettings = serializedObject.FindProperty("navigationGestures"); + windowsRailsNavigationGestures = serializedObject.FindProperty("railsNavigationGestures"); + windowsGestureAutoStart = serializedObject.FindProperty("windowsGestureAutoStart"); + } + + public override void OnInspectorGUI() + { + MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo(); + + if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured()) { return; } + + if (GUILayout.Button("Back to Controller Data Providers")) + { + Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.ControllerDataProvidersProfile; + } + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Windows Mixed Reality Controller Data Provider Settings", EditorStyles.boldLabel); + EditorGUILayout.HelpBox("This profile aids in configuring additional platform settings for the registered controller data provider. This can be anything from additional gestures or platform specific settings.", MessageType.Info); + + (target as BaseMixedRealityProfile).CheckProfileLock(); + + serializedObject.Update(); + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Windows Gesture Settings", EditorStyles.boldLabel); + EditorGUILayout.PropertyField(windowsGestureAutoStart); + EditorGUILayout.PropertyField(windowsManipulationGestureSettings); + EditorGUILayout.PropertyField(windowsNavigationGestureSettings); + EditorGUILayout.PropertyField(useRailsNavigation); + EditorGUILayout.PropertyField(windowsRailsNavigationGestures); + serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Inspectors/WindowsMixedRealityDataProviderProfileInspector.cs.meta b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Inspectors/WindowsMixedRealityDataProviderProfileInspector.cs.meta new file mode 100644 index 0000000..b6c8530 --- /dev/null +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Inspectors/WindowsMixedRealityDataProviderProfileInspector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42af8734ad68422db59c8649ced010b7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6e2e9d716bbb4d8382bd53f11996b90e, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Inspectors/WindowsMixedRealityMotionControllerMappingProfileInspector.cs b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Inspectors/WindowsMixedRealityMotionControllerMappingProfileInspector.cs index e6a70c7..33b3e41 100644 --- a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Inspectors/WindowsMixedRealityMotionControllerMappingProfileInspector.cs +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Inspectors/WindowsMixedRealityMotionControllerMappingProfileInspector.cs @@ -3,9 +3,12 @@ using UnityEditor; using XRTK.Inspectors.Profiles; +using XRTK.WindowsMixedReality.Profiles; -namespace XRTK.WindowsMixedReality.Profiles.Inspectors +namespace XRTK.WindowsMixedReality.Inspectors { [CustomEditor(typeof(WindowsMixedRealityMotionControllerMappingProfile))] - public class WindowsMixedRealityMotionControllerMappingProfileInspector : BaseMixedRealityControllerMappingProfileInspector { } + public class WindowsMixedRealityMotionControllerMappingProfileInspector : BaseMixedRealityControllerMappingProfileInspector + { + } } \ No newline at end of file diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealityControllerDataProviderProfile.cs b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealityControllerDataProviderProfile.cs new file mode 100644 index 0000000..7378d74 --- /dev/null +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealityControllerDataProviderProfile.cs @@ -0,0 +1,53 @@ +using UnityEngine; +using XRTK.Attributes; +using XRTK.Definitions.InputSystem; +using XRTK.Definitions.Utilities; +using XRTK.Providers.Controllers; + +namespace XRTK.WindowsMixedReality.Profiles +{ + [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Data Providers/Windows Mixed Reality", fileName = "WindowsMixedRealityControllerDataProviderProfile", order = (int)CreateProfileMenuItemIndices.Input)] + public class WindowsMixedRealityControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile + { + [EnumFlags] + [SerializeField] + [Tooltip("The recognizable Manipulation Gestures.")] + private WindowsGestureSettings manipulationGestures = 0; + + /// + /// The recognizable Manipulation Gestures. + /// + public WindowsGestureSettings ManipulationGestures => manipulationGestures; + + [EnumFlags] + [SerializeField] + [Tooltip("The recognizable Navigation Gestures.")] + private WindowsGestureSettings navigationGestures = 0; + + /// + /// The recognizable Navigation Gestures. + /// + public WindowsGestureSettings NavigationGestures => navigationGestures; + + [SerializeField] + [Tooltip("Should the Navigation use Rails on start?\nNote: This can be changed at runtime to switch between the two Navigation settings.")] + private bool useRailsNavigation = false; + + public bool UseRailsNavigation => useRailsNavigation; + + [EnumFlags] + [SerializeField] + [Tooltip("The recognizable Rails Navigation Gestures.")] + private WindowsGestureSettings railsNavigationGestures = 0; + + /// + /// The recognizable Navigation Gestures. + /// + public WindowsGestureSettings RailsNavigationGestures => railsNavigationGestures; + + [SerializeField] + private AutoStartBehavior windowsGestureAutoStart = AutoStartBehavior.AutoStart; + + public AutoStartBehavior WindowsGestureAutoStart => windowsGestureAutoStart; + } +} diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealityControllerDataProviderProfile.cs.meta b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealityControllerDataProviderProfile.cs.meta new file mode 100644 index 0000000..e9cae3b --- /dev/null +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealityControllerDataProviderProfile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fe9eeb08f95b1c1419ad17953d9a48ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6e2e9d716bbb4d8382bd53f11996b90e, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealityMotionControllerMappingProfile.cs b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealityMotionControllerMappingProfile.cs index 9f281df..db20f59 100644 --- a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealityMotionControllerMappingProfile.cs +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealityMotionControllerMappingProfile.cs @@ -10,7 +10,7 @@ namespace XRTK.WindowsMixedReality.Profiles { - [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Mixed Reality Controller Mappings/Windows Mixed Reality Controller Mapping Profile", fileName = "WindowsMixedRealityControllerMappingProfile")] + [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Mappings/Windows Mixed Reality Controller Mapping Profile", fileName = "WindowsMixedRealityControllerMappingProfile")] public class WindowsMixedRealityMotionControllerMappingProfile : BaseMixedRealityControllerMappingProfile { /// diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealitySpatialMeshObserverProfile.cs b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealitySpatialMeshObserverProfile.cs index 2ec7ae6..0c60907 100644 --- a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealitySpatialMeshObserverProfile.cs +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/Profiles/WindowsMixedRealitySpatialMeshObserverProfile.cs @@ -2,10 +2,11 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; +using XRTK.Definitions.Utilities; using XRTK.Providers.SpatialObservers; namespace XRTK.WindowsMixedReality.Profiles { - [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Spatial Observers/Windows Mixed Reality Spatial Mesh Data Provider Profile", fileName = "WindowsMixedRealitySpatialMeshObserverProfile")] + [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Spatial Observers/Windows Mixed Reality Spatial Mesh Data Provider Profile", fileName = "WindowsMixedRealitySpatialMeshObserverProfile", order = (int)CreateProfileMenuItemIndices.SpatialAwarenessDataProviders)] public class WindowsMixedRealitySpatialMeshObserverProfile : BaseMixedRealitySpatialMeshObserverProfile { } } \ No newline at end of file diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/SpatialObservers/WindowsMixedRealitySpatialMeshObserver.cs b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/SpatialObservers/WindowsMixedRealitySpatialMeshObserver.cs index ee7d846..2fe4a34 100644 --- a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/SpatialObservers/WindowsMixedRealitySpatialMeshObserver.cs +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/SpatialObservers/WindowsMixedRealitySpatialMeshObserver.cs @@ -37,12 +37,9 @@ public WindowsMixedRealitySpatialMeshObserver(string name, uint priority, Window { UnityEditor.PlayerSettings.WSA.SetCapability(UnityEditor.PlayerSettings.WSACapability.SpatialPerception, true); } -#endif // UNITY_EDITOR +#endif // UNITY_EDITOR observer = new SurfaceObserver(); - - // Apply the initial observer volume settings. - ConfigureObserverVolume(ObserverOrigin, ObservationExtents); #endif // UNITY_WSA } @@ -168,14 +165,14 @@ void OnDataReady(SurfaceData cookedData, bool outputWritten, float elapsedCookTi return; } - if (!SpatialMeshObjects.TryGetValue(cookedData.id.handle, out SpatialMeshObject meshObject)) + if (!SpatialMeshObjects.TryGetValue(cookedData.id.handle, out var meshObject)) { // Likely it was removed before data could be cooked. return; } // Apply the appropriate material to the mesh. - SpatialMeshDisplayOptions displayOption = MeshDisplayOption; + var displayOption = MeshDisplayOption; if (displayOption != SpatialMeshDisplayOptions.None) { @@ -208,7 +205,7 @@ void OnDataReady(SurfaceData cookedData, bool outputWritten, float elapsedCookTi } } } - else if (SpatialMeshObjects.TryGetValue(surfaceId.handle, out SpatialMeshObject meshObject)) + else if (SpatialMeshObjects.TryGetValue(surfaceId.handle, out var meshObject)) { RaiseMeshRemoved(meshObject); } diff --git a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/XRTK.WindowsMixedReality.asmdef b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/XRTK.WindowsMixedReality.asmdef index 9713511..c5a423f 100644 --- a/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/XRTK.WindowsMixedReality.asmdef +++ b/XRTK.WindowsMixedReality/Assets/XRTK.WindowsMixedReality/XRTK.WindowsMixedReality.asmdef @@ -4,17 +4,12 @@ "XRTK" ], "optionalUnityReferences": [], - "includePlatforms": [ - "Editor", - "WSA", - "WindowsStandalone32", - "WindowsStandalone64", - "XboxOne" - ], + "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, "overrideReferences": false, "precompiledReferences": [], "autoReferenced": true, - "defineConstraints": [] + "defineConstraints": [], + "versionDefines": [] } \ No newline at end of file diff --git a/XRTK.WindowsMixedReality/Packages/manifest.json b/XRTK.WindowsMixedReality/Packages/manifest.json index fd8bc27..eb2a55b 100644 --- a/XRTK.WindowsMixedReality/Packages/manifest.json +++ b/XRTK.WindowsMixedReality/Packages/manifest.json @@ -3,9 +3,8 @@ "com.unity.analytics": "3.2.2", "com.unity.package-manager-ui": "2.0.7", "com.unity.xr.windowsmr.metro": "1.0.8", - "com.xrtk.core": "https://github.com/XRTK/XRTK-Core.git#0.1.0", - "com.xrtk.sdk": "https://github.com/XRTK/SDK.git#0.1.0", - "com.xrtk.upm-git-extension": "https://github.com/XRTK/UpmGitExtension.git#0.9.1", + "com.xrtk.core": "https://github.com/XRTK/XRTK-Core.git#0.1.2", + "com.xrtk.upm-git-extension": "https://github.com/XRTK/UpmGitExtension.git#0.9.4", "com.unity.modules.ai": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.assetbundle": "1.0.0", @@ -36,5 +35,15 @@ "com.unity.modules.vr": "1.0.0", "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0" + }, + "lock": { + "com.xrtk.upm-git-extension": { + "hash": "869a63adece6138e88881e85f89f7994983db696", + "revision": "0.9.4" + }, + "com.xrtk.core": { + "hash": "c3e3c8fc9ae3549a1a501d07bff5dc3d857e2c94", + "revision": "0.1.2" + } } } diff --git a/XRTK.WindowsMixedReality/ProjectSettings/ProjectSettings.asset b/XRTK.WindowsMixedReality/ProjectSettings/ProjectSettings.asset index b0d06e7..4bf1139 100644 --- a/XRTK.WindowsMixedReality/ProjectSettings/ProjectSettings.asset +++ b/XRTK.WindowsMixedReality/ProjectSettings/ProjectSettings.asset @@ -290,7 +290,7 @@ PlayerSettings: m_Automatic: 1 m_BuildTargetVRSettings: - m_BuildTarget: Standalone - m_Enabled: 0 + m_Enabled: 1 m_Devices: - Oculus - OpenVR @@ -535,6 +535,7 @@ PlayerSettings: platformArchitecture: {} scriptingBackend: Metro: 1 + Standalone: 1 il2cppCompilerConfiguration: {} managedStrippingLevel: {} incrementalIl2cppBuild: {} diff --git a/XRTK.WindowsMixedReality/ProjectSettings/ProjectVersion.txt b/XRTK.WindowsMixedReality/ProjectSettings/ProjectVersion.txt index 06f6bc3..828e38d 100644 --- a/XRTK.WindowsMixedReality/ProjectSettings/ProjectVersion.txt +++ b/XRTK.WindowsMixedReality/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2018.3.10f1 +m_EditorVersion: 2018.3.11f1