点是否在矩形内
//点是否在矩形内 public static bool IsPointInRect(Vector2 p, Vector2 min, Vector2 max) { if (p.x < min.x || p.x > max.x) return false; if (p.y < min.y || p.y > max.y) return false; return true; }
点是否在圆内
//点是否在圆内 public static bool IsPointInCricle(Vector2 p, Vector2 center, float r) { return (p - center).sqrMagnitude <= r * r; }
标签:return,center,min,检测,Vector2,几何,形状,是否,max From: https://www.cnblogs.com/sailJs/p/17805667.html