public async void FireOnTouchUp() { if (OnTouchUp != null) { //OnTouchUp.Invoke("TouchUp", new System.EventArgs()); OnTouchUp.Invoke(this, new System.EventArgs()); } await this.ScaleTo(1, 50); }
internal void TouchUp() { _touchUpPosition = _touchPosition; if (OnTouchUp == null) { return; } OnTouchUp.Invoke(TouchPosition); }
private void TriggerTouchUp() { _frameTouchData.UpPosition = _frameTouchData.CurrentPosition; _frameTouchData.UpOverUI = _frameTouchData.CurrentlyOverUI; OnTouchUp?.Invoke(_frameTouchData); if (debugEvents) { Debug.Log("[DragCameraController]: Touch Up Triggered"); } }
public void OnPointerUp(PointerEventData eventData) { if (clicked) { if (!draging) { OnClick.Invoke(); } OnTouchUp.Invoke(); clicked = false; } }
public void OnPointerUp(PointerEventData eventData) { if (_eventType != EventType.TOUCH) { return; } if (true != _isTouchDown) { return; } _isTouchDown = false; OnTouchUp.Invoke(eventData); }
private void ProcessInput(List <Touch> touches, InputState state) { switch (state) { case InputState.None: break; case InputState.Press: if (touches[0].phase == TouchPhase.Began) { OnPressStart?.Invoke(touches[0].position); } break; case InputState.Sliding: Vector3 prevPos = _prevTouches[0].position; Vector3 currentPos = touches[0].position; OnSlide?.Invoke(prevPos, currentPos); break; case InputState.Up: OnTouchUp?.Invoke(touches[0].position); break; case InputState.Pinch: if (_prevState != InputState.Pinch) { return; } float prevLength = (_prevTouches[0].position - _prevTouches[1].position).magnitude; float currentLength = (touches[0].position - touches[1].position).magnitude; OnPinch?.Invoke(Mathf.Abs(prevLength - currentLength)); break; default: break; } }
private void CheckGesturesEditor() { if (Input.GetMouseButtonDown(0)) { Vector2 mousePos = Input.mousePosition; _lastMousePos = mousePos; _touchDownPos = mousePos; OnTouchDown?.Invoke(mousePos); } if (Input.GetMouseButton(0)) { Vector2 mousePos = Input.mousePosition; _touchDelta = mousePos - _lastMousePos; _scaledTouchDelta = new Vector2(_touchDelta.x / Screen.width, _touchDelta.y / Screen.height); _lastMousePos = mousePos; float _horizontalAxis = mousePos.x - _touchDownPos.x; float _verticalAxis = mousePos.y - _touchDownPos.y; _axis = new Vector2(_horizontalAxis, _verticalAxis).normalized; } else { _touchDelta = Vector2.zero; _scaledTouchDelta = Vector2.zero; _axis = Vector2.zero; } if (Input.GetMouseButtonUp(0)) { OnTouchUp?.Invoke(Input.mousePosition); } }
private void CheckGesturesMobile() { if (Input.touchCount > 0) { Touch touch = Input.GetTouch(0); if (touch.phase == TouchPhase.Began) { _touchDownPos = touch.position; OnTouchDown?.Invoke(touch.position); } if (touch.phase == TouchPhase.Moved) { Vector2 dragDistanceUnscaled = touch.deltaPosition; _scaledTouchDelta = new Vector2(dragDistanceUnscaled.x / Screen.width, dragDistanceUnscaled.y / Screen.height); float _horizontalAxis = touch.position.x - _touchDownPos.x; float _verticalAxis = touch.position.y - _touchDownPos.y; _axis = new Vector2(_horizontalAxis, _verticalAxis).normalized; } if (touch.phase == TouchPhase.Ended) { OnTouchUp.Invoke(touch.position); } } else { _touchDelta = Vector2.zero; _scaledTouchDelta = Vector2.zero; _axis = Vector2.zero; } }
private void InvokeOnTouchUp(SInputTouch touch) { OnTouchUp?.Invoke(touch); }
public virtual void OnPointerUp(PointerEventData eventData) { OnTouchUp?.Invoke(); }
private void OnUp() { OnTouchUp?.Invoke(this); }