Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Overlaps

Returns true if the other rectangle overlaps this one. If allowInverse is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.
Read time 2 minutesLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

Overlaps(Rect)

Returns true if the other rectangle overlaps this one. If
allowInverse
is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.
public readonly bool Overlaps(Rect other)

Parameters

other

Other rectangle to test overlapping with.

Returns

Type

Description

bool

Overlaps(Rect)

Returns true if the other rectangle overlaps this one. If
allowInverse
is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.
public readonly bool Overlaps(in Rect other)

Parameters

other

Other rectangle to test overlapping with.

Returns

Type

Description

bool

Overlaps(Rect, bool)

Returns true if the other rectangle overlaps this one. If
allowInverse
is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.
public readonly bool Overlaps(Rect other, bool allowInverse)

Parameters

other

Other rectangle to test overlapping with.

allowInverse

Does the test allow the widths and heights of the Rects to be negative?

Returns

Type

Description

bool

Overlaps(Rect, bool)

Returns true if the other rectangle overlaps this one. If
allowInverse
is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.
public readonly bool Overlaps(in Rect other, bool allowInverse)

Parameters

other

Other rectangle to test overlapping with.

allowInverse

Does the test allow the widths and heights of the Rects to be negative?

Returns

Type

Description

bool