Ejemplo n.º 1
0
        private void OnEnterListener(BaseEventData arg0)
        {
            if (OnEnter.Target == null)
            {
                return;
            }

            if (!VRTK4_EventSystem.IsVRTK4Active())
            {
                ForceEnter();
                return;
            }

            if (_isAlreadyEntered)
            {
                return;
            }

            ForceEnter();
        }
Ejemplo n.º 2
0
        private void OnExitListener(BaseEventData arg0)
        {
            if (OnExit.Target == null || !enabled)
            {
                return;
            }

            if (!VRTK4_EventSystem.IsVRTK4Active())
            {
                ForceExit();
                return;
            }

            // when multiple pointers overlap - each of them executes all events.
            // Make Sure to check if the object itself is still hovered by any of the pointers.
            if (VRTK4_UIPointer.CheckIfObjectIsHovered(OnExit.Target.gameObject))
            {
                return;
            }

            ForceExit();
        }