示例#1
0
        public static void SyncVRSetSwipeStart(this PointerEventData pointerEventData, Vector2 start)
        {
            SyncVRPointerEventData vrPointerEventData = pointerEventData as SyncVRPointerEventData;

            Assert.IsNotNull(vrPointerEventData);

            vrPointerEventData.swipeStart = start;
        }
示例#2
0
        public static Vector2 SyncVRGetSwipeStart(this PointerEventData pointerEventData)
        {
            SyncVRPointerEventData vrPointerEventData = pointerEventData as SyncVRPointerEventData;

            Assert.IsNotNull(vrPointerEventData);

            return(vrPointerEventData.swipeStart);
        }
示例#3
0
        public static Ray SyncVRGetRay(this PointerEventData pointerEventData)
        {
            SyncVRPointerEventData vrPointerEventData = pointerEventData as SyncVRPointerEventData;

            Assert.IsNotNull(vrPointerEventData);

            return(vrPointerEventData.worldSpaceRay);
        }
示例#4
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(SyncVRPointerEventData @from, SyncVRPointerEventData @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;
 }
示例#5
0
        protected bool GetPointerData(int id, out SyncVRPointerEventData data, bool create)
        {
            if (!m_VRRayPointerData.TryGetValue(id, out data) && create)
            {
                data = new SyncVRPointerEventData(eventSystem)
                {
                    pointerId = id,
                };

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