Exemple #1
0
        protected override void OnHandleDragging(HandleEventData eventData)
        {
            var worldPosition = GetRayPoint(eventData);

            eventData.deltaPosition = worldPosition - m_LastPosition;
            m_LastPosition          = worldPosition;

            base.OnHandleDragging(eventData);
        }
Exemple #2
0
        protected override void OnHandleDragStarted(HandleEventData eventData)
        {
            var linearEventData = (LinearHandleEventData)eventData;

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

            base.OnHandleDragStarted(eventData);
        }
Exemple #3
0
        protected override void OnHandleHovering(HandleEventData eventData)
        {
            if (m_DragSources.Count == 0)
            {
                UpdateEventData((LinearHandleEventData)eventData);
            }

            base.OnHandleHovering(eventData);
        }
Exemple #4
0
        protected override void OnHandleDragStarted(HandleEventData eventData)
        {
            var planeEventData = eventData as PlaneHandleEventData;

            m_LastPosition = planeEventData.raycastHitWorldPosition;

            m_Plane.SetNormalAndPosition(transform.forward, transform.position);

            base.OnHandleDragStarted(eventData);
        }
Exemple #5
0
        protected override void OnHandleDragStarted(HandleEventData eventData)
        {
            var linearEventData = eventData as LinearHandleEventData;

            m_LastPosition = linearEventData.raycastHitWorldPosition;

            UpdatePlaneOrientation(eventData.rayOrigin);
            UpdateHandleTip(linearEventData);

            base.OnHandleDragStarted(eventData);
        }
Exemple #6
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);
            }
        }
Exemple #7
0
        protected override void OnHandleDragStarted(HandleEventData eventData)
        {
            var sphereEventData = eventData as SphereHandleEventData;

            m_CurrentRadius = sphereEventData.raycastHitDistance;

            m_LastPosition = GetRayPoint(eventData);

            m_ScrollRate = k_InitialScrollRate;

            base.OnHandleDragStarted(eventData);
        }
Exemple #8
0
        protected override void OnHandleDragStarted(HandleEventData eventData)
        {
            var rayOrigin = eventData.rayOrigin;

            var radialEventData = (RadialHandleEventData)eventData;

            m_LastPositions[rayOrigin]    = radialEventData.raycastHitWorldPosition;
            m_LastDragForwards[rayOrigin] = rayOrigin.forward;

            m_Plane.SetNormalAndPosition(rayOrigin.forward, transform.position);

            base.OnHandleDragStarted(eventData);
        }
Exemple #9
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);
        }
Exemple #10
0
        protected override void OnHandleDragStarted(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.OnHandleDragStarted(eventData);
            }
        }
Exemple #11
0
        protected override void OnHandleDragStarted(HandleEventData eventData)
        {
            Transform rayOrigin = eventData.rayOrigin;

            var radialEventData = eventData as RadialHandleEventData;

            m_LastPosition    = radialEventData.raycastHitWorldPosition;
            m_LastDragForward = rayOrigin.forward;

            m_Plane.SetNormalAndPosition(rayOrigin.forward, transform.position);

            m_DragTangent = Vector3.Cross(transform.up, startDragPosition - transform.position);

            UpdateHandleTip(radialEventData);

            base.OnHandleDragStarted(eventData);
        }
Exemple #12
0
 protected override void OnHandleHoverStarted(HandleEventData eventData)
 {
     UpdateHandleTip(eventData as LinearHandleEventData);
     base.OnHandleHoverStarted(eventData);
 }
Exemple #13
0
 protected override void OnHandleHoverEnded(HandleEventData eventData)
 {
     UpdateHandleTip(eventData as RadialHandleEventData);
     base.OnHandleHoverEnded(eventData);
 }
Exemple #14
0
 protected override void OnHandleHovering(HandleEventData eventData)
 {
     UpdateHandleTip(eventData as RadialHandleEventData);
 }
Exemple #15
0
        protected override void OnHandleDragging(HandleEventData eventData)
        {
            UpdateEventData((LinearHandleEventData)eventData);

            base.OnHandleDragging(eventData);
        }
Exemple #16
0
 protected override void OnHandleHoverEnded(HandleEventData eventData)
 {
     transform.localScale /= k_ScaleBump;
     base.OnHandleHoverStarted(eventData);
 }
Exemple #17
0
 protected override void OnHandleDragEnded(HandleEventData eventData)
 {
     transform.localScale /= k_HideScale;
     base.OnHandleDragEnded(eventData);
 }