Exemplo n.º 1
0
    private void DetectSwipeDirection(Vector3 dragVector)
    {
        var positiveX = Mathf.Abs(dragVector.x);
        var positiveY = Mathf.Abs(dragVector.y);

        if (positiveX > positiveY)
        {
            _controller.CheckSwipe(dragVector.x > 0 ? Ball.BallType.Right : Ball.BallType.Left);
        }
        else
        {
            _controller.CheckSwipe(dragVector.y > 0 ? Ball.BallType.Top : Ball.BallType.Bottom);
        }
    }