文档

Unity Engine

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.
阅读时间1 分钟最后更新于 1 个月前

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 bool Overlaps(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 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