分别记录两个矩形的左下与右上角坐标
///unity c#
public static bool IsOverlapping(Vector2Int oneMin, Vector2Int oneMax, Vector2Int twoMin, Vector2Int twoMax)
{
return Mathf.Max(oneMin.x, twoMin.x) <= Mathf.Min(oneMax.x, twoMax.x) &&
Mathf.Max(oneMin.y, twoMin.y) <= Mathf.Min(oneMax.y, twoMax.y);
}
从别处看的,自己也测过了,那种十字架的形状也是OK的。