Unity中计算点到线的距离
private double pointToLine(Vector2 point1, Vector2 point2, Vector2 position)//point1和point2为线的两个端点 { double space = 0; double a, b, c; a = Vector2.Distance(point1,point2);/