Пример #1
0
 /// <summary>
 /// Convenience function for cloning PointerEventData
 /// </summary>
 /// <param name="from">Copy this value</param>
 /// <param name="to">to this object</param>
 protected void CopyFromTo(VRPointerEventData @from, VRPointerEventData @to)
 {
     @to.position              = @from.position;
     @to.delta                 = @from.delta;
     @to.scrollDelta           = @from.scrollDelta;
     @to.pointerCurrentRaycast = @from.pointerCurrentRaycast;
     @to.pointerEnter          = @from.pointerEnter;
     @to.worldSpaceRay         = @from.worldSpaceRay;
 }
Пример #2
0
        protected bool GetPointerData(int id, out VRPointerEventData data, bool create)
        {
            if (!m_VRRayPointerData.TryGetValue(id, out data) && create)
            {
                data = new VRPointerEventData(eventSystem)
                {
                    pointerId = id,
                };

                m_VRRayPointerData.Add(id, data);
                return(true);
            }
            return(false);
        }