摘要:
抄的Unity的源码 HandleUtility.DistancePointLine 是UnityEditor代码,源码如下,这样就可以在Runtime中运行 注意性能开销! /// <summary> /// 计算点到线段的最短距离 /// </summary> /// <param name=" 阅读全文
摘要:
bool ContainsPoint(List<Vector2> polyPoints, Vector2 p) { var j = polyPoints.Count - 1; var inside = false; for (int i = 0; i < polyPoints.Count; j = 阅读全文