Skip to content

Commit 7fef894

Browse files
committed
Added InputActionProperty click to SceneHitTest
1 parent 20f1a82 commit 7fef894

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

Packages/webxr-interactions/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010
- An option to set depthStencilFormat in MixedRealityCaptureController.
11+
- InputActionProperty click to SceneHitTest. Now project is not forced to use old Input Manager.
1112

1213
### Changed
1314
- XR Interaction Toolkit sample XR Rig now use 1 camera instead of cameras group.

Packages/webxr-interactions/Runtime/Scripts/SceneHitTest.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class SceneHitTest : MonoBehaviour
2222
private InputActionProperty leftTrigger;
2323
[SerializeField]
2424
private InputActionProperty rightTrigger;
25+
[SerializeField]
26+
private InputActionProperty click;
2527
#endif
2628

2729
private bool isFollowing = false;
@@ -94,7 +96,14 @@ bool GetControllersButtonDown()
9496

9597
void Update()
9698
{
97-
if (isFollowing && (Input.GetMouseButtonDown(0) || GetControllersButtonDown()))
99+
if (isFollowing && (
100+
#if UNITY_INPUT_SYSTEM_1_4_4_OR_NEWER
101+
(useInputSystem && click.action?.IsPressed() == true) ||
102+
#endif
103+
#if ENABLE_LEGACY_INPUT_MANAGER
104+
Input.GetMouseButtonDown(0) ||
105+
#endif
106+
GetControllersButtonDown()))
98107
{
99108
isFollowing = false;
100109
visual.SetActive(false);

Packages/webxr-interactions/Samples~/XRInteractionToolkit/Scenes/WebXRInteractionToolkit.unity

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8157,6 +8157,19 @@ MonoBehaviour:
81578157
m_Flags: 0
81588158
m_Reference: {fileID: 3279264004350380116, guid: c348712bda248c246b8c49b3db54643f,
81598159
type: 3}
8160+
click:
8161+
m_UseReference: 1
8162+
m_Action:
8163+
m_Name: Click
8164+
m_Type: 0
8165+
m_ExpectedControlType:
8166+
m_Id: 927472d9-94ca-4011-ab4f-9cd8ffae70e8
8167+
m_Processors:
8168+
m_Interactions:
8169+
m_SingletonActionBindings: []
8170+
m_Flags: 0
8171+
m_Reference: {fileID: 1855836014308820768, guid: c348712bda248c246b8c49b3db54643f,
8172+
type: 3}
81608173
--- !u!4 &1241030032
81618174
Transform:
81628175
m_ObjectHideFlags: 0

0 commit comments

Comments
 (0)