public static void SyncVRSetSwipeStart(this PointerEventData pointerEventData, Vector2 start) { SyncVRPointerEventData vrPointerEventData = pointerEventData as SyncVRPointerEventData; Assert.IsNotNull(vrPointerEventData); vrPointerEventData.swipeStart = start; }
public static Vector2 SyncVRGetSwipeStart(this PointerEventData pointerEventData) { SyncVRPointerEventData vrPointerEventData = pointerEventData as SyncVRPointerEventData; Assert.IsNotNull(vrPointerEventData); return(vrPointerEventData.swipeStart); }
public static Ray SyncVRGetRay(this PointerEventData pointerEventData) { SyncVRPointerEventData vrPointerEventData = pointerEventData as SyncVRPointerEventData; Assert.IsNotNull(vrPointerEventData); return(vrPointerEventData.worldSpaceRay); }
/// <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; }
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); }