Beispiel #1
0
    public void OnDrag(PointerEventData e)
    {
        if (!_dragging)
        {
            _direction = (Mathf.Abs(e.delta.x) >= Mathf.Abs(e.delta.y))? new Vector2(1, 0) : new Vector2(0, 1);
            _dragging  = true;
        }

        if (_direction.x == 1)
        {
            _controller.DragScreen(e.delta * _direction);
        }
    }