コード例 #1
0
    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}");
        }
    }
コード例 #2
0
        // 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}");
            }
        }