File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Packages/webxr-interactions/Runtime/Scripts Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,12 @@ public class ControllerInteraction : MonoBehaviour
34
34
public GameObject inputProfileHandModelParent ;
35
35
36
36
[ Header ( "Input Bindings" ) ]
37
- [ SerializeField ] private WebXRController . ButtonTypes [ ] pickupButtons = new WebXRController . ButtonTypes [ ] {
37
+ [ SerializeField ] private WebXRController . ButtonTypes [ ] defaultPickupButtons = new WebXRController . ButtonTypes [ ] {
38
38
WebXRController . ButtonTypes . Trigger ,
39
39
WebXRController . ButtonTypes . Grip ,
40
40
WebXRController . ButtonTypes . ButtonA
41
41
} ;
42
+ private WebXRController . ButtonTypes [ ] pickupButtons ;
42
43
43
44
private Vector3 currentVelocity ;
44
45
private Vector3 previousPos ;
@@ -62,6 +63,7 @@ private void Awake()
62
63
attachJoint = GetComponent < FixedJoint > ( ) ;
63
64
hasAnimator = animator != null ;
64
65
controller = gameObject . GetComponent < WebXRController > ( ) ;
66
+ pickupButtons = defaultPickupButtons ;
65
67
#if WEBXR_INPUT_PROFILES
66
68
if ( inputProfileObject != null )
67
69
{
@@ -574,5 +576,10 @@ private Rigidbody GetNearestRigidBody()
574
576
575
577
return nearestRigidBody ;
576
578
}
579
+
580
+ public void SetPickupButtons ( params WebXRController . ButtonTypes [ ] pickupButtons )
581
+ {
582
+ this . pickupButtons = pickupButtons != null ? pickupButtons : defaultPickupButtons ;
583
+ }
577
584
}
578
585
}
You can’t perform that action at this time.
0 commit comments