Skip to content

Commit 1644cb0

Browse files
authored
Don't share controller and source collections between instances (#11266)
1 parent 56beaf9 commit 1644cb0

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Assets/MRTK/Core/Providers/UnityInput/UnityJoystickManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public UnityJoystickManager(
5454

5555
private const float DeviceRefreshInterval = 3.0f;
5656

57-
protected static readonly Dictionary<string, GenericJoystickController> ActiveControllers = new Dictionary<string, GenericJoystickController>();
57+
protected readonly Dictionary<string, GenericJoystickController> ActiveControllers = new Dictionary<string, GenericJoystickController>();
5858

5959
private float deviceRefreshTimer;
6060
private string[] lastDeviceList;

Assets/MRTK/Core/Providers/UnityInput/UnityTouchDeviceManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public UnityTouchDeviceManager(
5050
uint priority = DefaultPriority,
5151
BaseMixedRealityProfile profile = null) : base(inputSystem, name, priority, profile) { }
5252

53-
private static readonly Dictionary<int, UnityTouchController> ActiveTouches = new Dictionary<int, UnityTouchController>();
53+
private readonly Dictionary<int, UnityTouchController> ActiveTouches = new Dictionary<int, UnityTouchController>();
5454

5555
private List<UnityTouchController> touchesToRemove = new List<UnityTouchController>();
5656

Assets/MRTK/Providers/OpenXR/Scripts/OpenXREyeGazeDataProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public OpenXREyeGazeDataProvider(
7575
public event Action OnSaccadeY;
7676
private void GazeSmoother_OnSaccadeY() => OnSaccadeY?.Invoke();
7777

78-
private static readonly List<InputDevice> InputDeviceList = new List<InputDevice>();
78+
private readonly List<InputDevice> InputDeviceList = new List<InputDevice>();
7979
private InputDevice eyeTrackingDevice = default(InputDevice);
8080

8181
#region IMixedRealityCapabilityCheck Implementation

Assets/MRTK/Providers/XRSDK/XRSDKDeviceManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public virtual bool CheckCapability(MixedRealityCapability capability)
4545
return (capability == MixedRealityCapability.MotionController);
4646
}
4747

48-
protected static readonly Dictionary<InputDevice, GenericXRSDKController> ActiveControllers = new Dictionary<InputDevice, GenericXRSDKController>();
48+
protected readonly Dictionary<InputDevice, GenericXRSDKController> ActiveControllers = new Dictionary<InputDevice, GenericXRSDKController>();
4949

5050
private readonly List<InputDevice> inputDevices = new List<InputDevice>();
5151
private readonly List<InputDevice> inputDevicesSubset = new List<InputDevice>();
@@ -149,7 +149,7 @@ public override void Disable()
149149
InputDevices.deviceDisconnected -= InputDevices_deviceDisconnected;
150150

151151
var controllersCopy = ActiveControllers.ToReadOnlyCollection();
152-
foreach (var controller in controllersCopy)
152+
foreach (KeyValuePair<InputDevice, GenericXRSDKController> controller in controllersCopy)
153153
{
154154
RemoveController(controller.Key);
155155
}

0 commit comments

Comments
 (0)