private void RaiseInputSourceEvent(byte mask, WebXRInputSourceEventTypes type, WebXRInputEvent webxrInputEvent, UnityEvent unityEvent, WebXRInput inputSource) { if (((WebXRInputSourceEventTypes)mask & type) == type) { unityEvent.Invoke(); webxrInputEvent.Invoke(inputSource); Debug.Log($"{inputSource.Handedness} : {type}"); } }
// Raise input sources select and squeeze events private static void RaiseInputSourceEvent(byte mask, WebXRInputSourceEventTypes type, WebXRInputEvent webxrInputEvent, UnityEvent unityEvent, WebXRInputSource inputSource) { if (((WebXRInputSourceEventTypes)mask & type) == type) { switch (type) { case WebXRInputSourceEventTypes.SelectStart: inputSource.Selected = true; break; case WebXRInputSourceEventTypes.SelectEnd: inputSource.Selected = false; break; case WebXRInputSourceEventTypes.SqueezeStart: inputSource.Squeezed = true; break; case WebXRInputSourceEventTypes.SqueezeEnd: inputSource.Squeezed = false; break; } unityEvent.Invoke(); webxrInputEvent.Invoke(inputSource); Debug.Log($"{inputSource.Handedness} : {type}"); } }