Exemplo n.º 1
0
 void IPointerUpHandler.OnPointerUp(PointerEventData eventData)
 {
     if (!IsMute)
     {
         PointerUp?.Invoke();
     }
 }
Exemplo n.º 2
0
 public void InvokePointerUp(Vector2 pointerPosition)
 {
     if (PointerUp != null)
     {
         PointerUp.Invoke(this, new PointerGraphicalElementEventArgs(pointerPosition));
     }
 }
Exemplo n.º 3
0
    public void OnPointerUp(PointerEventData eventData)
    {
        _inputVector = Vector2.zero;
        _stick.Stick.anchoredPosition = Vector2.zero;
        _phone.VibrateMini();

        PointerUp?.Invoke();
    }
Exemplo n.º 4
0
    public void OnPointerUp(PointerEventData eventData)
    {
        if (bricks.Count > 0)
        {
            PointerUp.Invoke(this);
        }

        StartCoroutine(DoLocalMove(cachedPosition));
        StartCoroutine(DoLocalScale(cachedScale));
    }
Exemplo n.º 5
0
        private void OnPointerUp(EventSystemData Data)
        {
            if (!IsDrag_)
            {
                return;
            }

            PointerUp?.Invoke(Data.Location);
            CheckLongPressed();
            IsDrag_           = false;
            PreviousDownTime_ = 0;
        }
Exemplo n.º 6
0
 public void OnPointerUp(PointerEventData eventData)
 {
     if (_pointerDownCalled == false)
     {
         return;
     }
     if (preventCameraControl && _cameraControl)
     {
         _cameraControl.NoCtrlCondition = _noControlFunctionCached;
     }
     _pointerDownCalled = false;
     PointerUp?.Invoke(eventData);
 }
Exemplo n.º 7
0
        private void Element_MouseUp(object sender, MouseButtonEventArgs args)
        {
            var id       = GetMouseButton(args);
            var buttons  = GetMouseButtons(args);
            var position = GetPosition(args);

            if (FirstMouseButton == id)
            {
                FirstMouseButton = 0;
            }

            PointerUp?.Invoke(this, new PointerEventArgs(CurrentTime, position, PointerId.FromMouse(id), buttons));
        }
Exemplo n.º 8
0
 private void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         tapPosition = Input.mousePosition;
     }
     if (Input.GetMouseButton(0))
     {
         DirectionChanged?.Invoke(Input.mousePosition - tapPosition);
     }
     if (Input.GetMouseButtonUp(0))
     {
         PointerUp?.Invoke();
     }
 }
Exemplo n.º 9
0
        private void UpdatePointerState(bool state)
        {
            if (IsPointerDown == state)
            {
                return;
            }

            IsPointerDown = state;
            PointerEventData ev = new PointerEventData(null);

            if (IsPointerDown)
            {
                if (_driveColliders)
                {
                    foreach (IPointerDownHandler down in _downHandlers)
                    {
                        down.OnPointerDown(ev);
                    }
                    foreach (IMouseDownHandler down in _mouseDownHandlers)
                    {
                        down.OnMouseDown();
                    }
                    //TODO - does Click mean it needs both a down + up?
                    foreach (IPointerClickHandler click in _clickHandlers)
                    {
                        click.OnPointerClick(ev);
                    }
                }
                PointerDown.Invoke(this, ev);
            }
            else
            {
                if (_driveColliders)
                {
                    foreach (IPointerUpHandler up in _upHandlers)
                    {
                        up.OnPointerUp(ev);
                    }
                    foreach (IMouseUpHandler up in _mouseUpHandlers)
                    {
                        up.OnMouseUp();
                    }
                }
                PointerUp.Invoke(this, ev);
            }
        }
        public void ReadTouch()
        {
            var touchPosition = _touchDevice.ReadTouchPoints();
            int pressure      = _touchDevice.Pressure;

            if (pressure > 5)
            {
                if (!_penPressed)
                {
                    _penPressed = true;
                    var _ = _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                    {
                        PointerDown?.Invoke(this, new PointerEventArgs()
                        {
                            Position = touchPosition, Pressure = pressure
                        });
                    });
                }
                else
                {
                    var _ = _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                    {
                        PointerMoved?.Invoke(this, new PointerEventArgs()
                        {
                            Position = touchPosition, Pressure = pressure
                        });
                    });
                }
            }
            else if (pressure < 2 && _penPressed == true)
            {
                _penPressed = false;
                var _ = _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    PointerUp?.Invoke(this, new PointerEventArgs()
                    {
                        Position = touchPosition
                    });
                });
            }
        }
Exemplo n.º 11
0
 private void TriggerPointerUp()
 {
     PointerUp?.Invoke(this);
 }
Exemplo n.º 12
0
        public void OnPointerUp(PointerEventData eventData)
        {
            IsUsing = false;

            PointerUp?.Invoke();
        }
Exemplo n.º 13
0
        public void OnPointerUp(PointerEventData eventData)
        {
            Debug.Log($"On pointer up: {_buttonIndex}");

            PointerUp?.Invoke(eventData, this);
        }
Exemplo n.º 14
0
 public void OnPointerUp(PointerEventData eventData)
 {
     pointerDown = false;
     PointerUp?.Invoke();
 }
Exemplo n.º 15
0
 public virtual void OnPointerUp(PointerEventData eventData)
 {
     m_IsPressed = false;
     PointerUp?.Invoke(this, eventData);
     ForwardToParents <IPointerUpHandler>((parent) => parent.OnPointerUp(eventData));
 }
Exemplo n.º 16
0
 protected virtual void OnPointerUp(object sender, PointerButtonEventArgs e)
 {
     PointerUp?.Invoke(sender, e);
 }
Exemplo n.º 17
0
 public void OnPointerUp(PointerEventData eventData)
 {
     PointerUp?.Invoke(eventData.position);
 }
Exemplo n.º 18
0
 public override void OnPointerUp(PointerEventData eventData)
 {
     base.OnPointerUp(eventData);
     PointerUp?.Invoke();
 }