Skip to content

Commit 5aa8751

Browse files
committed
It works! Hands/Controller switching
1 parent 585a169 commit 5aa8751

File tree

8 files changed

+159
-45
lines changed

8 files changed

+159
-45
lines changed

MainProject/Assets/XR/Settings/Open XR Package Settings.asset

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ MonoBehaviour:
5353
m_Script: {fileID: 11500000, guid: 4e314dfef9af0904e80129bcc0a79361, type: 3}
5454
m_Name: HandTracking Standalone
5555
m_EditorClassIdentifier:
56-
m_enabled: 0
56+
m_enabled: 1
5757
nameUi: Hand Tracking Subsystem
5858
version: 0.0.1
5959
featureIdInternal: com.unity.openxr.feature.input.handtracking
@@ -73,7 +73,7 @@ MonoBehaviour:
7373
m_Script: {fileID: 11500000, guid: b3aced3429e5911458f4da2dac9d0f29, type: 3}
7474
m_Name: MetaHandTrackingAim Standalone
7575
m_EditorClassIdentifier:
76-
m_enabled: 0
76+
m_enabled: 1
7777
nameUi: Meta Hand Tracking Aim
7878
version: 0.0.1
7979
featureIdInternal: com.unity.openxr.feature.input.metahandtrackingaim
@@ -290,7 +290,7 @@ MonoBehaviour:
290290
m_Script: {fileID: 11500000, guid: feeef8d85de8db242bdda70cc7ff5acd, type: 3}
291291
m_Name: OculusTouchControllerProfile Standalone
292292
m_EditorClassIdentifier:
293-
m_enabled: 1
293+
m_enabled: 0
294294
nameUi: Oculus Touch Controller Profile
295295
version: 0.0.1
296296
featureIdInternal: com.unity.openxr.feature.input.oculustouch

MainProject/Assets/XRI/Settings/Resources/XRDeviceSimulatorSettings.asset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ MonoBehaviour:
1313
m_Name: XRDeviceSimulatorSettings
1414
m_EditorClassIdentifier:
1515
m_AutomaticallyInstantiateSimulatorPrefab: 0
16+
m_AutomaticallyInstantiateInEditorOnly: 1
1617
m_SimulatorPrefab: {fileID: 0}

MainProject/Packages/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"dependencies": {
1313
"com.de-panther.webxr-input-profiles-loader": "0.4.0",
14-
"com.unity.ide.rider": "3.0.24",
14+
"com.unity.ide.rider": "3.0.26",
1515
"com.unity.ide.visualstudio": "2.0.18",
1616
"com.unity.ide.vscode": "1.2.5",
1717
"com.unity.inputsystem": "1.7.0",

MainProject/Packages/packages-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"url": "https://packages.unity.com"
5757
},
5858
"com.unity.ide.rider": {
59-
"version": "3.0.24",
59+
"version": "3.0.26",
6060
"depth": 0,
6161
"source": "registry",
6262
"dependencies": {

MainProject/ProjectSettings/ProjectSettings.asset

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ PlayerSettings:
136136
vulkanEnableCommandBufferRecycling: 1
137137
loadStoreDebugModeEnabled: 0
138138
bundleVersion: 0.1
139-
preloadedAssets:
140-
- {fileID: 11400000, guid: 9200075b9150b364996d99532e344a14, type: 2}
141-
- {fileID: -3226570840052702836, guid: 5b0903de6c5e23b4a9cdf346520d272d, type: 2}
142-
- {fileID: 11400000, guid: a5e5b7605fb48984988490688c2a74e2, type: 2}
143-
- {fileID: 2478256764130162806, guid: 552445d583cb06c4eaf9d56596dd45c2, type: 2}
139+
preloadedAssets: []
144140
metroInputSource: 0
145141
wsaTransparentSwapchain: 0
146142
m_HolographicPauseOnTrackingLoss: 1

Packages/webxr-interactions/Runtime/InputSystem/WebXRHandsProvider.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ public void SetIsTracked(Handedness handedness, bool isTracked)
154154

155155
var handState = handedness == Handedness.Left ? leftHandData : rightHandData;
156156
handState.enabled = isTracked;
157+
158+
if (!leftHandData.enabled && !rightHandData.enabled)
159+
{
160+
updateHandsAllowed = false;
161+
}
157162
}
158163

159164
[Preserve, RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]

Packages/webxr-interactions/Runtime/InputSystem/WebXRInputDevices.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace WebXR.InputSystem
1212
using InputSystem = UnityEngine.InputSystem.InputSystem;
1313
public struct WebXRHMDState : IInputStateTypeInfo
1414
{
15-
public static FourCC Format => new FourCC('X', 'R', 'D', 'I');
15+
public static FourCC Format => new FourCC('W', 'X', 'R', 'H');
1616

1717
public readonly FourCC format => Format;
1818

@@ -86,7 +86,7 @@ public void OnHeadsetUpdate(
8686

8787
public struct WebXRControllerState : IInputStateTypeInfo
8888
{
89-
public static FourCC Format => new FourCC('X', 'R', 'D', 'I');
89+
public static FourCC Format => new FourCC('W', 'X', 'R', 'C');
9090

9191
public readonly FourCC format => Format;
9292

0 commit comments

Comments
 (0)