Exemplo n.º 1
0
    public SwipeDirection GetSwipe()
    {
        // Calculates the closest SwipeDirection by looking at the swipeAngle.
        float          swipeAngle = VectorMath.AcuteAngle(Vector2.up, (EndPoint - StartPoint).normalized, true);
        SwipeDirection swipeDir   = (SwipeDirection)(Mathf.RoundToInt(swipeAngle / 90f) % 4);

        return(swipeDir);
    }