public void InvokePointerDown(Vector2 pointerPosition) { if (PointerDown != null) { PointerDown.Invoke(this, new PointerGraphicalElementEventArgs(pointerPosition)); } }
void IPointerDownHandler.OnPointerDown(PointerEventData eventData) { if (!IsMute) { PointerDown?.Invoke(); } }
private bool GetMouseInput() { if (Input.GetMouseButtonDown(0)) { _startPressPos = Input.mousePosition; _currPressPos = _startPressPos; _isSwipeEnded = false; TouchBegan?.Invoke(_startPressPos); } else if (Input.GetMouseButtonUp(0)) { _endPressPos = Input.mousePosition; _isSwipeEnded = true; TouchEnd?.Invoke(_endPressPos); return(true); } else if (Input.GetMouseButton(0)) { _lastPressPos = _currPressPos; _currPressPos = Input.mousePosition; PointerDown?.Invoke(_currPressPos); return(true); } return(false); }
public void OnPointerDown(PointerEventData eventData) { if (preventCameraControl && _cameraControl) { _noControlFunctionCached = _cameraControl.NoCtrlCondition; _cameraControl.NoCtrlCondition = () => true; } _pointerDownCalled = true; _cachedDragPosition = toDrag.position; _cachedMousePosition = Input.mousePosition; PointerDown?.Invoke(eventData); }
private void OnPointerDown(EventSystemData Data) { if (!Enabled) { return; } PointerDown?.Invoke(Data.Location); IsDrag_ = true; IsClick_ = true; PreviousDownTime_ = Time.realtimeSinceStartup; }
public void OnPointerDown(PointerEventData eventData) { if (eventData.pointerCurrentRaycast.gameObject.tag != "Brick") { return; } pointerDown = true; int index = eventData.pointerCurrentRaycast.gameObject.transform.GetSiblingIndex(); PointerDown?.Invoke(index); }
private void Element_MouseDown(object sender, MouseButtonEventArgs args) { var id = GetMouseButton(args); var buttons = GetMouseButtons(args); var position = GetPosition(args); if (FirstMouseButton == 0) { FirstMouseButton = id; } PointerDown?.Invoke(this, new PointerEventArgs(CurrentTime, position, PointerId.FromMouse(id), buttons)); }
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 }); }); } }
private bool GetTouchInput() { if (Input.touches.Length > 0) { var touch = Input.GetTouch(0); switch (touch.phase) { case TouchPhase.Began: _startPressPos = touch.position; _currPressPos = _startPressPos; _isSwipeEnded = false; TouchBegan?.Invoke(touch.position); break; case TouchPhase.Ended: case TouchPhase.Canceled: _endPressPos = touch.position; _isSwipeEnded = true; TouchEnd?.Invoke(touch.position); return(true); case TouchPhase.Moved: case TouchPhase.Stationary: _lastPressPos = _currPressPos; _currPressPos = touch.position; PointerDown?.Invoke(touch.position); return(true); } } return(false); }
public virtual void OnPointerDown(PointerEventData eventData) { _pointersCount++; PointerDown.SafeInvoke(eventData); }
public void OnPointerDown(PointerEventData eventData) { OnDrag(eventData); PointerDown?.Invoke(); }
public void OnPointerDown(PointerEventData eventData) { PointerDown?.Invoke(eventData.position); }
public void OnPointerDown(PointerEventData eventData) { Debug.Log($"On pointer down: {_buttonIndex}"); PointerDown?.Invoke(eventData, this); }
public virtual void OnPointerDown(PointerEventData eventData) { m_IsPressed = true; PointerDown?.Invoke(this, eventData); ForwardToParents <IPointerDownHandler>((parent) => parent.OnPointerDown(eventData)); }
public void OnPointerDown(PointerEventData eventData) { IsDragging = true; PointerDown.SafeInvoke(_mainCamera.ScreenToWorldPoint(eventData.position)); }
protected virtual void OnPointerDown(object sender, PointerButtonEventArgs e) { PointerDown?.Invoke(sender, e); }
public void OnPointerDown(PointerEventData eventData) { IsUsing = true; PointerDown?.Invoke(); }
public virtual void OnPointerDown(PointerEventData eventData) { PointerDown.SafeInvoke(eventData); }
public override void OnPointerDown(PointerEventData eventData) { base.OnPointerDown(eventData); PointerDown?.Invoke(); }