UnityEngine.Physics2D.OverlapArea C# (CSharp) Method

OverlapArea() public static method

Check if a collider falls within a rectangular area.

public static OverlapArea ( Vector2 pointA, Vector2 pointB, [ layerMask, [ minDepth, [ maxDepth ) : Collider2D
pointA Vector2 One corner of the rectangle.
pointB Vector2 Diagonally opposite corner of the rectangle.
layerMask [ Filter to check objects only on specific layers.
minDepth [ Only include objects with a Z coordinate (depth) greater than or equal to this value.
maxDepth [ Only include objects with a Z coordinate (depth) less than or equal to this value.
return Collider2D
        public static Collider2D OverlapArea(Vector2 pointA, Vector2 pointB, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
        {
            return INTERNAL_CALL_OverlapArea(ref pointA, ref pointB, layerMask, minDepth, maxDepth);
        }

Same methods

Physics2D::OverlapArea ( Vector2 pointA, Vector2 pointB ) : Collider2D
Physics2D::OverlapArea ( Vector2 pointA, Vector2 pointB, int layerMask ) : Collider2D
Physics2D::OverlapArea ( Vector2 pointA, Vector2 pointB, int layerMask, float minDepth ) : Collider2D
Physics2D