Skip to content

Commit ba4a7da

Browse files
author
David Kline
authored
Merge pull request #3490 from keveleigh/wmr-device-manager-cleanup
Change WMR.RemoveController to take in an InteractionSource
2 parents e925357 + ce3a825 commit ba4a7da

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealityDeviceManager.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public override void Disable()
379379
InteractionSourceState[] states = InteractionManager.GetCurrentReading();
380380
for (var i = 0; i < states.Length; i++)
381381
{
382-
RemoveController(states[i]);
382+
RemoveController(states[i].source);
383383
}
384384
}
385385

@@ -444,16 +444,16 @@ private WindowsMixedRealityController GetController(InteractionSource interactio
444444
/// Remove the selected controller from the Active Store
445445
/// </summary>
446446
/// <param name="interactionSourceState">Source State provided by the SDK to remove</param>
447-
private void RemoveController(InteractionSourceState interactionSourceState)
447+
private void RemoveController(InteractionSource interactionSource)
448448
{
449-
var controller = GetController(interactionSourceState.source, false);
449+
var controller = GetController(interactionSource, false);
450450

451451
if (controller != null)
452452
{
453453
MixedRealityToolkit.InputSystem?.RaiseSourceLost(controller.InputSource, controller);
454454
}
455455

456-
activeControllers.Remove(interactionSourceState.source.id);
456+
activeControllers.Remove(interactionSource.id);
457457
}
458458

459459
#endregion Controller Utilities
@@ -484,7 +484,7 @@ private void InteractionManager_InteractionSourceDetected(InteractionSourceDetec
484484
/// <param name="args">SDK source updated event arguments</param>
485485
private void InteractionManager_InteractionSourceLost(InteractionSourceLostEventArgs args)
486486
{
487-
RemoveController(args.state);
487+
RemoveController(args.state.source);
488488
}
489489

490490
#endregion Unity InteractionManager Events

0 commit comments

Comments
 (0)