UnityEngine.Physics2D.OverlapBox C# (CSharp) Method

OverlapBox() public static method

Check if a collider falls within a box area.

public static OverlapBox ( Vector2 point, Vector2 size, float angle, [ layerMask, [ minDepth, [ maxDepth ) : Collider2D
point Vector2 Center of the box.
size Vector2 Size of the box.
angle float Angle of the box.
layerMask [ Filter to check objects only on specific layers.
minDepth [ Only include objects with a Z coordinate (depth) greater than this value.
maxDepth [ Only include objects with a Z coordinate (depth) less than this value.
return Collider2D
        public static Collider2D OverlapBox(Vector2 point, Vector2 size, float angle, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
        {
            return INTERNAL_CALL_OverlapBox(ref point, ref size, angle, layerMask, minDepth, maxDepth);
        }

Same methods

Physics2D::OverlapBox ( Vector2 point, Vector2 size, float angle ) : Collider2D
Physics2D::OverlapBox ( Vector2 point, Vector2 size, float angle, int layerMask ) : Collider2D
Physics2D::OverlapBox ( Vector2 point, Vector2 size, float angle, int layerMask, float minDepth ) : Collider2D
Physics2D