コード例 #1
0
 public async void FireOnTouchUp()
 {
     if (OnTouchUp != null)
     {
         //OnTouchUp.Invoke("TouchUp", new System.EventArgs());
         OnTouchUp.Invoke(this, new System.EventArgs());
     }
     await this.ScaleTo(1, 50);
 }
コード例 #2
0
ファイル: Controller.cs プロジェクト: smallant/Sycophant
 internal void TouchUp()
 {
     _touchUpPosition = _touchPosition;
     if (OnTouchUp == null)
     {
         return;
     }
     OnTouchUp.Invoke(TouchPosition);
 }
コード例 #3
0
    private void TriggerTouchUp()
    {
        _frameTouchData.UpPosition = _frameTouchData.CurrentPosition;
        _frameTouchData.UpOverUI   = _frameTouchData.CurrentlyOverUI;

        OnTouchUp?.Invoke(_frameTouchData);

        if (debugEvents)
        {
            Debug.Log("[DragCameraController]: Touch Up Triggered");
        }
    }
コード例 #4
0
    public void OnPointerUp(PointerEventData eventData)
    {
        if (clicked)
        {
            if (!draging)
            {
                OnClick.Invoke();
            }

            OnTouchUp.Invoke();
            clicked = false;
        }
    }
コード例 #5
0
ファイル: UIButton.cs プロジェクト: keltonxian/salon
 public void OnPointerUp(PointerEventData eventData)
 {
     if (_eventType != EventType.TOUCH)
     {
         return;
     }
     if (true != _isTouchDown)
     {
         return;
     }
     _isTouchDown = false;
     OnTouchUp.Invoke(eventData);
 }
コード例 #6
0
        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;
            }
        }
コード例 #7
0
        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);
            }
        }
コード例 #8
0
        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;
            }
        }
コード例 #9
0
 private void InvokeOnTouchUp(SInputTouch touch)
 {
     OnTouchUp?.Invoke(touch);
 }
コード例 #10
0
 public virtual void OnPointerUp(PointerEventData eventData)
 {
     OnTouchUp?.Invoke();
 }
コード例 #11
0
 private void OnUp()
 {
     OnTouchUp?.Invoke(this);
 }