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)); } }
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)); } }
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)); } }
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)); } }
public InteractEventArgs(VrCtrl _controller, Rigidbody _rb, Collider _collider) { controller = _controller; rb = _rb; collider = _collider; }
private InteractEventArgs GenerateArgs(VrCtrl _controller) => new InteractEventArgs(_controller, rigidbody, collider);