File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Packages/webxr-interactions/Runtime/Scripts Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public class ControllerInteraction : MonoBehaviour
34
34
public GameObject inputProfileHandModelParent ;
35
35
36
36
[ Header ( "Input Bindings" ) ]
37
- [ SerializeField ] private List < WebXRController . ButtonTypes > pickupButtons = new List < WebXRController . ButtonTypes > {
37
+ [ SerializeField ] private WebXRController . ButtonTypes [ ] pickupButtons = new WebXRController . ButtonTypes [ ] {
38
38
WebXRController . ButtonTypes . Trigger ,
39
39
WebXRController . ButtonTypes . Grip ,
40
40
WebXRController . ButtonTypes . ButtonA
@@ -122,14 +122,18 @@ private void Update()
122
122
controller . GetAxis ( WebXRController . AxisTypes . Grip ) ) ;
123
123
124
124
bool pickup = false ;
125
- pickupButtons . ForEach ( button => pickup = pickup || controller . GetButtonDown ( button ) ) ;
125
+ for ( int i = 0 ; i < pickupButtons . Length ; i ++ ) {
126
+ pickup = pickup || controller . GetButtonDown ( pickupButtons [ i ] ) ;
127
+ }
126
128
if ( pickup )
127
129
{
128
130
Pickup ( ) ;
129
131
}
130
132
131
133
bool drop = false ;
132
- pickupButtons . ForEach ( button => drop = drop || controller . GetButtonUp ( button ) ) ;
134
+ for ( int i = 0 ; i < pickupButtons . Length ; i ++ ) {
135
+ drop = drop || controller . GetButtonUp ( pickupButtons [ i ] ) ;
136
+ }
133
137
if ( drop )
134
138
{
135
139
Drop ( ) ;
You can’t perform that action at this time.
0 commit comments