AngleOfLine() public static method

获取一条线以起始点为圆心的顺时针旋转角度
public static AngleOfLine ( Vector2 start, Vector2 end ) : double
start Vector2
end Vector2
return double
    void OnGestureTap(float distance)
    {
        Vector2 start = Camera.main.WorldToScreenPoint(transform.position);
        Vector2 end   = g.LastPoint;
        var     angle = MathUtil.AngleOfLine(start, end);

        Attack(angle);
    }
示例#2
0
    public void HandleGestureSwipe(Vector2 point, float distance)
    {
        if (OnGestureSwipe == null)
        {
            return;
        }
        var angle = MathUtil.AngleOfLine(beginPoint, point);

        OnGestureSwipe.Invoke(angle, distance);
    }