Exemplo n.º 1
0
    private void SendSwipe(SwipeDirection direction)
    {
        SwipeData swipeData = new SwipeData()
        {
            Direction     = direction,
            StartPosition = fingerDownPosition,
            EndPosition   = fingerUpPosition
        };

        OnSwipe(swipeData);

        if (direction == SwipeDirection.Up && controller.IsOnGround())
        {
            controller.CallJump();
        }
        else if (direction == SwipeDirection.Down && controller.IsOnGround() && !controller.isSliding)
        {
            controller.SlideStart();
        }
    }