protected override void OnHandlePointerDown(HandleEventData eventData) { var linearEventData = (LinearHandleEventData)eventData; m_LastPositions[eventData.rayOrigin] = linearEventData.raycastHitWorldPosition; UpdateEventData(linearEventData); base.OnHandlePointerDown(eventData); }
protected override void OnHandleHovering(HandleEventData eventData) { if (m_DragSources.Count == 0) { UpdateEventData((LinearHandleEventData)eventData); } base.OnHandleHovering(eventData); }
protected override void OnHandlePointerDown(HandleEventData eventData) { var planeEventData = eventData as PlaneHandleEventData; m_LastPositions[eventData.rayOrigin] = planeEventData.raycastHitWorldPosition; m_Plane.SetNormalAndPosition(transform.forward, transform.position); base.OnHandlePointerDown(eventData); }
protected override void OnHandleDragging(HandleEventData eventData) { if (IndexOfDragSource(eventData.rayOrigin) == 0) { var worldPosition = GetRayPoint(eventData); eventData.deltaPosition = worldPosition - m_LastPosition; m_LastPosition = worldPosition; base.OnHandleDragging(eventData); } }
protected override void OnHandleHoverStarted(HandleEventData eventData) { var linearEventData = (LinearHandleEventData)eventData; m_LastPositions[eventData.rayOrigin] = linearEventData.raycastHitWorldPosition; if (m_DragSources.Count == 0) { UpdateEventData(linearEventData); } base.OnHandleHoverStarted(eventData); }
protected override void OnHandlePointerDown(HandleEventData eventData) { var rayOrigin = eventData.rayOrigin; var radialEventData = (RadialHandleEventData)eventData; m_LastPositions[rayOrigin] = radialEventData.raycastHitWorldPosition; var forward = rayOrigin.forward; m_LastRayDirection[rayOrigin] = forward; m_Plane.SetNormalAndPosition(forward, transform.position); base.OnHandlePointerDown(eventData); }
protected override void OnHandlePointerDown(HandleEventData eventData) { var sphereEventData = (SphereHandleEventData)eventData; var rayOrigin = eventData.rayOrigin; if (IndexOfDragSource(rayOrigin) == 0) { m_CurrentRadius = sphereEventData.raycastHitDistance; m_ScrollRate = k_InitialScrollRate; m_LastPosition = GetRayPoint(eventData); base.OnHandlePointerDown(eventData); } }
protected override void OnHandleDragging(HandleEventData eventData) { UpdateEventData((LinearHandleEventData)eventData); base.OnHandleDragging(eventData); }
Vector3 GetRayPoint(HandleEventData eventData) { return(eventData.GetRay().GetPoint(m_CurrentRadius)); }