Skip to content

Commit c36b550

Browse files
authored
Merge pull request #4 from Microsoft/mrtk_development
Mrtk development
2 parents 8ad15b6 + c6c31c8 commit c36b550

File tree

43 files changed

+593
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+593
-362
lines changed

Assets/MixedRealityToolkit.Providers/OpenVR/OpenVRDeviceManager.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.MixedReality.Toolkit.Core.Definitions;
66
using Microsoft.MixedReality.Toolkit.Core.Definitions.Devices;
77
using Microsoft.MixedReality.Toolkit.Core.Definitions.Utilities;
8+
using Microsoft.MixedReality.Toolkit.Core.Interfaces;
89
using Microsoft.MixedReality.Toolkit.Core.Interfaces.InputSystem;
910
using Microsoft.MixedReality.Toolkit.Core.Providers.UnityInput;
1011
using Microsoft.MixedReality.Toolkit.Core.Services;
@@ -24,10 +25,16 @@ public class OpenVRDeviceManager : UnityJoystickManager
2425
/// <summary>
2526
/// Constructor.
2627
/// </summary>
28+
/// <param name="registrar">The <see cref="IMixedRealityServiceRegistrar"/> instance that loaded the service.</param>
29+
/// <param name="spatialAwarenessSystem">The <see cref="IMixedRealitySpatialAwarenessSystem"/> to which the observer is providing data.</param>
2730
/// <param name="name">Friendly name of the service.</param>
2831
/// <param name="priority">Service priority. Used to determine order of instantiation.</param>
2932
/// <param name="profile">The service's configuration profile.</param>
30-
public OpenVRDeviceManager(string name, uint priority, BaseMixedRealityProfile profile) : base(name, priority, profile) { }
33+
public OpenVRDeviceManager(
34+
IMixedRealityServiceRegistrar registrar,
35+
string name = null,
36+
uint priority = DefaultPriority,
37+
BaseMixedRealityProfile profile = null) : base(registrar, name, priority, profile) { }
3138

3239
#region Controller Utilities
3340

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealityDeviceManager.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,15 @@ public class WindowsMixedRealityDeviceManager : BaseDeviceManager, IMixedReality
3131
/// <summary>
3232
/// Constructor.
3333
/// </summary>
34+
/// <param name="registrar">The <see cref="IMixedRealityServiceRegistrar"/> instance that loaded the service.</param>
3435
/// <param name="name">Friendly name of the service.</param>
3536
/// <param name="priority">Service priority. Used to determine order of instantiation.</param>
3637
/// <param name="profile">The service's configuration profile.</param>
37-
public WindowsMixedRealityDeviceManager(string name, uint priority, BaseMixedRealityProfile profile) : base(name, priority, profile) { }
38+
public WindowsMixedRealityDeviceManager(
39+
IMixedRealityServiceRegistrar registrar,
40+
string name = null,
41+
uint priority = DefaultPriority,
42+
BaseMixedRealityProfile profile = null) : base(registrar, name, priority, profile) { }
3843

3944
#if UNITY_WSA
4045

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealitySpatialMeshObserver.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.MixedReality.Toolkit.Core.Definitions;
66
using Microsoft.MixedReality.Toolkit.Core.Definitions.SpatialAwarenessSystem;
77
using Microsoft.MixedReality.Toolkit.Core.Definitions.Utilities;
8+
using Microsoft.MixedReality.Toolkit.Core.Interfaces;
89
using Microsoft.MixedReality.Toolkit.Core.Interfaces.SpatialAwarenessSystem;
910
using Microsoft.MixedReality.Toolkit.Core.Interfaces.SpatialAwarenessSystem.Observers;
1011
using Microsoft.MixedReality.Toolkit.Core.Providers;
@@ -28,10 +29,16 @@ public class WindowsMixedRealitySpatialMeshObserver : BaseSpatialObserver, IMixe
2829
/// <summary>
2930
/// Constructor.
3031
/// </summary>
32+
/// <param name="registrar">The <see cref="IMixedRealityServiceRegistrar"/> instance that loaded the service.</param>
3133
/// <param name="name">Friendly name of the service.</param>
3234
/// <param name="priority">Service priority. Used to determine order of instantiation.</param>
3335
/// <param name="profile">The service's configuration profile.</param>
34-
public WindowsMixedRealitySpatialMeshObserver(string name, uint priority, BaseMixedRealityProfile profile) : base(name, priority, profile)
36+
public WindowsMixedRealitySpatialMeshObserver(
37+
IMixedRealityServiceRegistrar registrar,
38+
IMixedRealitySpatialAwarenessSystem spatialAwarenessSystem,
39+
string name = null,
40+
uint priority = DefaultPriority,
41+
BaseMixedRealityProfile profile = null) : base(registrar, spatialAwarenessSystem, name, priority, profile)
3542
{
3643
ReadProfile();
3744
}

Assets/MixedRealityToolkit.Providers/WindowsVoiceInput/WindowsDictationInputProvider.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Microsoft.MixedReality.Toolkit.Core.Attributes;
55
using Microsoft.MixedReality.Toolkit.Core.Definitions;
66
using Microsoft.MixedReality.Toolkit.Core.Definitions.Utilities;
7+
using Microsoft.MixedReality.Toolkit.Core.Interfaces;
78
using Microsoft.MixedReality.Toolkit.Core.Interfaces.Devices;
89
using Microsoft.MixedReality.Toolkit.Core.Interfaces.InputSystem;
910
using Microsoft.MixedReality.Toolkit.Core.Providers;
@@ -27,10 +28,15 @@ public class WindowsDictationInputProvider : BaseDeviceManager, IMixedRealityDic
2728
/// <summary>
2829
/// Constructor.
2930
/// </summary>
31+
/// <param name="registrar">The <see cref="IMixedRealityServiceRegistrar"/> instance that loaded the service.</param>
3032
/// <param name="name">Friendly name of the service.</param>
3133
/// <param name="priority">Service priority. Used to determine order of instantiation.</param>
3234
/// <param name="profile">The service's configuration profile.</param>
33-
public WindowsDictationInputProvider(string name, uint priority, BaseMixedRealityProfile profile) : base(name, priority, profile) { }
35+
public WindowsDictationInputProvider(
36+
IMixedRealityServiceRegistrar registrar,
37+
string name = null,
38+
uint priority = DefaultPriority,
39+
BaseMixedRealityProfile profile = null) : base(registrar, name, priority, profile) { }
3440

3541
/// <summary>
3642
/// Is the Dictation Manager currently running?

Assets/MixedRealityToolkit.Providers/WindowsVoiceInput/WindowsSpeechInputProvider.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.MixedReality.Toolkit.Core.Definitions;
66
using Microsoft.MixedReality.Toolkit.Core.Definitions.InputSystem;
77
using Microsoft.MixedReality.Toolkit.Core.Definitions.Utilities;
8+
using Microsoft.MixedReality.Toolkit.Core.Interfaces;
89
using Microsoft.MixedReality.Toolkit.Core.Interfaces.Devices;
910
using Microsoft.MixedReality.Toolkit.Core.Interfaces.InputSystem;
1011
using Microsoft.MixedReality.Toolkit.Core.Providers;
@@ -26,10 +27,15 @@ public class WindowsSpeechInputProvider : BaseDeviceManager, IMixedRealitySpeech
2627
/// <summary>
2728
/// Constructor.
2829
/// </summary>
30+
/// <param name="registrar">The <see cref="IMixedRealityServiceRegistrar"/> instance that loaded the service.</param>
2931
/// <param name="name">Friendly name of the service.</param>
3032
/// <param name="priority">Service priority. Used to determine order of instantiation.</param>
3133
/// <param name="profile">The service's configuration profile.</param>
32-
public WindowsSpeechInputProvider(string name, uint priority, BaseMixedRealityProfile profile) : base(name, priority, profile) { }
34+
public WindowsSpeechInputProvider(
35+
IMixedRealityServiceRegistrar registrar,
36+
string name = null,
37+
uint priority = DefaultPriority,
38+
BaseMixedRealityProfile profile = null) : base(registrar, name, priority, profile) { }
3339

3440
/// <summary>
3541
/// The keywords to be recognized and optional keyboard shortcuts.

Assets/MixedRealityToolkit.SDK/Features/UX/Interactable/Scripts/Interactable.cs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace Microsoft.MixedReality.Toolkit.SDK.UX.Interactable
3535

3636
[System.Serializable]
3737

38-
public class Interactable : MonoBehaviour, IMixedRealityFocusHandler, IMixedRealityInputHandler, IMixedRealityPointerHandler, IMixedRealitySpeechHandler // TEMP , IInputClickHandler, IFocusable, IInputHandler
38+
public class Interactable : MonoBehaviour, IMixedRealityFocusChangedHandler, IMixedRealityFocusHandler, IMixedRealityInputHandler, IMixedRealityPointerHandler, IMixedRealitySpeechHandler // TEMP , IInputClickHandler, IFocusable, IInputHandler
3939
{
4040
/// <summary>
4141
/// Setup the input system
@@ -518,17 +518,37 @@ private void RemovePointer(IMixedRealityPointer pointer)
518518

519519
#endregion PointerManagement
520520

521-
#region MixedRealityFocusHandlers
521+
#region MixedRealityFocusChangedHandlers
522522

523-
public void OnFocusEnter(FocusEventData eventData)
523+
public void OnBeforeFocusChange(FocusEventData eventData)
524524
{
525525
if (!CanInteract())
526526
{
527527
return;
528528
}
529529

530-
AddPointer(eventData.Pointer);
531-
SetFocus(pointers.Count > 0);
530+
if (eventData.NewFocusedObject == gameObject)
531+
{
532+
AddPointer(eventData.Pointer);
533+
}
534+
else if (eventData.OldFocusedObject == gameObject)
535+
{
536+
RemovePointer(eventData.Pointer);
537+
}
538+
}
539+
540+
public void OnFocusChanged(FocusEventData eventData) {}
541+
542+
#endregion MixedRealityFocusChangedHandlers
543+
544+
#region MixedRealityFocusHandlers
545+
546+
public void OnFocusEnter(FocusEventData eventData)
547+
{
548+
if (CanInteract())
549+
{
550+
SetFocus(pointers.Count > 0);
551+
}
532552
}
533553

534554
public void OnFocusExit(FocusEventData eventData)
@@ -538,7 +558,6 @@ public void OnFocusExit(FocusEventData eventData)
538558
return;
539559
}
540560

541-
RemovePointer(eventData.Pointer);
542561
SetFocus(pointers.Count > 0);
543562
}
544563

Assets/MixedRealityToolkit.SDK/Inspectors/Input/Handlers/SpeechInputHandlerInspector.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,18 @@ private void ShowList(SerializedProperty list)
113113
// the remove element button
114114
bool elementRemoved = GUILayout.Button(RemoveButtonContent, EditorStyles.miniButton, MiniButtonWidth);
115115

116+
EditorGUILayout.EndHorizontal();
117+
116118
if (elementRemoved)
117119
{
118120
list.DeleteArrayElementAtIndex(index);
119-
}
120121

121-
EditorGUILayout.EndHorizontal();
122+
if (index == list.arraySize)
123+
{
124+
EditorGUI.indentLevel--;
125+
return;
126+
}
127+
}
122128

123129
SerializedProperty keywordProperty = speechCommandProperty.FindPropertyRelative("keyword");
124130

0 commit comments

Comments
 (0)