コード例 #1
0
 public void OnObjectUsed(VrCtrl _controller)
 {
     //If the object is being used or if it is any input source
     if (isUsable && (_controller.InputSource == allowedSource || allowedSource == SteamVR_Input_Sources.Any))
     {
         onUsed.Invoke(GenerateArgs(_controller));
     }
 }
コード例 #2
0
 public void OnObjectStopTouching(VrCtrl _controller)
 {
     //If the object is not being touched or if it is any input source
     if (isTouchable && (_controller.InputSource == allowedSource || allowedSource == SteamVR_Input_Sources.Any))
     {
         onStopTouching.Invoke(GenerateArgs(_controller));
     }
 }
コード例 #3
0
 public void OnObjectReleased(VrCtrl _controller)
 {
     //If the object is grabbable or if it is any input source
     if (isGrabbable && (_controller.InputSource == allowedSource || allowedSource == SteamVR_Input_Sources.Any))
     {
         onReleased.Invoke(GenerateArgs(_controller));
     }
 }
コード例 #4
0
 public void OnObjectStopUsing(VrCtrl _controller)
 {
     //If the object has stopped being using or if it is any input source
     if (isUsable && (_controller.InputSource == allowedSource || allowedSource == SteamVR_Input_Sources.Any))
     {
         onStopUsing.Invoke(GenerateArgs(_controller));
     }
 }
コード例 #5
0
 public InteractEventArgs(VrCtrl _controller, Rigidbody _rb, Collider _collider)
 {
     controller = _controller;
     rb         = _rb;
     collider   = _collider;
 }
コード例 #6
0
 private InteractEventArgs GenerateArgs(VrCtrl _controller) => new InteractEventArgs(_controller, rigidbody, collider);