Ejemplo n.º 1
0
        private void ScrollerEndDrag(EnhancedScroller scroller, PointerEventData data)
        {
            switch (m_ScrollAngle)
            {
            case ScrollAngle.X:
                m_HomeScrollerView.m_Scroller.OnEndDrag(data);
                m_HomeScrollerView.m_Scroller.ScrollRect.OnEndDrag(data);
                break;

            case ScrollAngle.Y:
                m_BallScrollerView.m_Scroller.ScrollRect.OnEndDrag(data);
                break;
            }

            m_ScrollAngle = ScrollAngle.None;
        }
Ejemplo n.º 2
0
 private void ScrollerBeginDrag(EnhancedScroller scroller, PointerEventData data)
 {
     if (m_ScrollAngle == ScrollAngle.None)
     {
         if (Mathf.Abs(data.position.y - data.pressPosition.y) > 1)
         {
             m_ScrollAngle = ScrollAngle.Y;
             m_BallScrollerView.m_Scroller.ScrollRect.enabled = true;
             m_BallScrollerView.m_Scroller.ScrollRect.OnBeginDrag(data);
         }
         else if (Mathf.Abs(data.position.x - data.pressPosition.x) > 1)
         {
             m_ScrollAngle = ScrollAngle.X;
             m_BallScrollerView.m_Scroller.ScrollRect.enabled = false;
             m_HomeScrollerView.m_Scroller.OnBeginDrag(data);
             m_HomeScrollerView.m_Scroller.ScrollRect.OnBeginDrag(data);
         }
     }
 }