Example #1
0
    private void ReadSwipe(Swipe swipe)
    {
        if (swipe.Movement().magnitude > minSwipeDistance)
        {
            switch (swipe.Direction())
            {
            case swipeDirection.top:
                outputText.text = "top swipe";
                break;

            case swipeDirection.rightTop:
                outputText.text = "rightTop swipe";
                break;

            case swipeDirection.right:
                outputText.text = "right swipe";
                break;

            case swipeDirection.rightDown:
                outputText.text = "rightDown swipe";
                break;

            case swipeDirection.down:
                outputText.text = "down swipe";
                break;

            case swipeDirection.leftDown:
                outputText.text = "leftDown swipe";
                break;

            case swipeDirection.left:
                outputText.text = "left swipe";
                break;

            case swipeDirection.leftTop:
                outputText.text = "leftTop swipe";
                break;
            }
        }
        else
        {
            if (swipe.Ended && swipe.Tap)
            {
                outputText.text = "Tap";
            }
        }
    }