public override void OnPointerClick(PointerEventData eventData)
    {
        base.OnPointerClick(eventData);

#if INSTANTVR_ADVANCED
        if (eventData.currentInputModule.GetType() == typeof(IVR_Interaction))
        {
            InteractionEventData interactionData = (InteractionEventData)eventData;
            InstantVR            ivr             = eventData.currentInputModule.transform.GetComponent <InstantVR>();

            switch (interactionData.inputDevice)
            {
            case InputDeviceIDs.LeftHand:
                if (ivr.leftHandMovements.GetType() == typeof(IVR_HandMovements))
                {
                    IVR_HandMovements handMovements = (IVR_HandMovements)ivr.leftHandMovements;
                    handMovements.Grab(this.gameObject);
                }
                break;

            case InputDeviceIDs.RightHand:
                if (ivr.rightHandMovements.GetType() == typeof(IVR_HandMovements))
                {
                    IVR_HandMovements handMovements = (IVR_HandMovements)ivr.rightHandMovements;
                    handMovements.Grab(this.gameObject);
                }
                break;
            }
        }
#endif
    }
Example #2
0
        public static void SendInteractionEvent(bool state, bool isPlaying, bool deepProfile, bool flatten, bool userCode)
        {
            if (!UnityEngine.Analytics.Analytics.enabled || !EnableAnalytics())
            {
                return;
            }

            var data = new InteractionEventData()
            {
                eipState    = state,
                isPlaying   = isPlaying,
                deepProfile = deepProfile,
                flatten     = flatten,
                userCode    = userCode
            };

            EditorAnalytics.SendEventWithLimit(k_InteractionEventName, data);
        }