예제 #1
0
        protected override void OnHandlePointerDown(HandleEventData eventData)
        {
            var linearEventData = (LinearHandleEventData)eventData;

            m_LastPositions[eventData.rayOrigin] = linearEventData.raycastHitWorldPosition;
            UpdateEventData(linearEventData);

            base.OnHandlePointerDown(eventData);
        }
예제 #2
0
        protected override void OnHandleHovering(HandleEventData eventData)
        {
            if (m_DragSources.Count == 0)
            {
                UpdateEventData((LinearHandleEventData)eventData);
            }

            base.OnHandleHovering(eventData);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
            }
        }
예제 #8
0
        protected override void OnHandleDragging(HandleEventData eventData)
        {
            UpdateEventData((LinearHandleEventData)eventData);

            base.OnHandleDragging(eventData);
        }
예제 #9
0
 Vector3 GetRayPoint(HandleEventData eventData)
 {
     return(eventData.GetRay().GetPoint(m_CurrentRadius));
 }