Example #1
0
        public void OnPointerEnter(PointerEventData eventData)
        {
            // Since canvas graphics render facing the negative Z direction,
            // negative z is the forward direction for a canvas element.
            float metersToCanvasScale = GvrUIHelpers.GetMetersToCanvasScale(page);

            desiredPositionZ = -hoverPositionZMeters / metersToCanvasScale;
        }
Example #2
0
        protected float GetMetersToCanvasScale()
        {
            if (metersToCanvasScale == null)
            {
                metersToCanvasScale = GvrUIHelpers.GetMetersToCanvasScale(transform);
            }

            return(metersToCanvasScale.Value);
        }
Example #3
0
    public void OnPointerEnter(PointerEventData eventData)
    {
#if UNITY_HAS_GOOGLEVR && (UNITY_ANDROID || UNITY_EDITOR)
        // Since canvas graphics render facing the negative Z direction,
        // negative z is the forward direction for a canvas element.
        float metersToCanvasScale = GvrUIHelpers.GetMetersToCanvasScale(page);
        desiredPositionZ = -hoverPositionZMeters / metersToCanvasScale;
#endif  // UNITY_HAS_GOOGLEVR && (UNITY_ANDROID || UNITY_EDITOR)
    }
 protected float GetMetersToCanvasScale()
 {
     return(GvrUIHelpers.GetMetersToCanvasScale(transform));
 }