Ejemplo n.º 1
0
    private void UpdateReticlePointer(EventController event_controller)
    {
        WVR_DeviceType           _type       = event_controller.device;
        GameObject               _prevObject = event_controller.prevRaycastedObject;
        PointerEventData         _event_data = event_controller.event_data;
        WaveVR_ControllerPointer _pointer    = event_controller.pointer;
        WaveVR_Beam              _beam       = event_controller.beam;

        if (_pointer != null && _beam != null)
        {
            Vector3    _intersectionPosition = GetIntersectionPosition(_event_data.enterEventCamera, _event_data.pointerCurrentRaycast);
            GameObject _go = GetRaycastedObject(_type);

            if (_go != _prevObject)
            {
                if (_go != null)
                {
                    _pointer.SetPointerColor(new Color32(11, 220, 249, 255));
                    _pointer.OnPointerEnter(_event_data.enterEventCamera, _go, _intersectionPosition, true);
                    _beam.SetEndOffset(_intersectionPosition, false);
                }
                else
                {
                    _pointer.SetPointerColor(Color.white);
                    _pointer.OnPointerExit(_event_data.enterEventCamera, _prevObject);
                    _beam.ResetEndOffset();
                }
            }
        }
    }
Ejemplo n.º 2
0
    private void UpdateReticlePointer_Right()
    {
        if (reticlePointer_right != null && beam_right != null)
        {
            Vector3    _intersectionPosition = GetIntersectionPosition(rightHandPointer.enterEventCamera, rightHandPointer.pointerCurrentRaycast);
            GameObject _go = GetRightHandObject();

            if (_go != prevObject_right)
            {
                if (_go != null)
                {
                    reticlePointer_right.SetPointerColor(new Color32(11, 220, 249, 255));
                    reticlePointer_right.OnPointerEnter(rightHandPointer.enterEventCamera, _go, _intersectionPosition, true);
                    beam_right.SetEndOffset(_intersectionPosition, false);
                }
                else
                {
                    reticlePointer_right.SetPointerColor(Color.white);
                    reticlePointer_right.OnPointerExit(rightHandPointer.enterEventCamera, prevObject_right);
                    beam_right.ResetEndOffset();
                }
            }
        }
    }