Exemplo n.º 1
0
        private void OnPointerUp(PointerUpEvent evt)
        {
            bool flag = evt.pointerId == this.m_ScrollingPointerId;

            if (flag)
            {
                evt.currentTarget.ReleasePointer(evt.pointerId);
                evt.StopPropagation();
                bool flag2 = this.touchScrollBehavior == ScrollView.TouchScrollBehavior.Elastic || this.hasInertia;
                if (flag2)
                {
                    this.ComputeInitialSpringBackVelocity();
                    bool flag3 = this.m_PostPointerUpAnimation == null;
                    if (flag3)
                    {
                        this.m_PostPointerUpAnimation = base.schedule.Execute(new Action(this.PostPointerUpAnimation)).Every(30L);
                    }
                    else
                    {
                        this.m_PostPointerUpAnimation.Resume();
                    }
                }
                this.m_ScrollingPointerId = PointerId.invalidPointerId;
            }
        }
        internal void OnPointerUpEvent(PointerUpEvent evt)
        {
            if (!useDragEvents)
            {
                if (m_DragState == DragState.Dragging)
                {
                    m_Target.ReleasePointer(evt.pointerId);
                    OnDrop(evt.position);
                    ClearDragAndDropUI();
                    evt.StopPropagation();
                }
            }

            m_DragState = DragState.None;
        }
Exemplo n.º 3
0
        void OnPointerUp(PointerUpEvent evt)
        {
            var selectedIndex = GetSelectedIndex();

            if (selectedIndex != -1)
            {
                var item = m_Items[selectedIndex];
                item.action?.Invoke();
                item.actionUserData?.Invoke(item.element.userData);

                Hide(true);
            }

            if (evt.pointerId != PointerId.mousePointerId)
            {
                m_MenuContainer.panel.PreventCompatibilityMouseEvents(evt.pointerId);
            }

            evt.StopPropagation();
        }
Exemplo n.º 4
0
        void OnPointerUp(PointerUpEvent evt)
        {
            if (evt.pointerId == m_ScrollingPointerId)
            {
                evt.currentTarget.ReleasePointer(evt.pointerId);
                evt.StopPropagation();

                if (touchScrollBehavior == TouchScrollBehavior.Elastic || hasInertia)
                {
                    ComputeInitialSpringBackVelocity();

                    if (m_PostPointerUpAnimation == null)
                    {
                        m_PostPointerUpAnimation = schedule.Execute(PostPointerUpAnimation).Every(30);
                    }
                    else
                    {
                        m_PostPointerUpAnimation.Resume();
                    }
                }

                m_ScrollingPointerId = PointerId.invalidPointerId;
            }
        }