ドキュメント

Unity Engine

Unity Engine

isOverlapped

Gets whether the distance represents an overlap or not.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
public bool isOverlapped { get; }

Remarks

The ColliderDistance2D.distance can be positive indicating that the Collider2D are separated (not overlapped), zero indicating that they are touching (but not overlapped) or negative indicating that they are overlapped.
This property is therefore a check to see if ColliderDistance2D.distance is negative which indicates the Collider2D are overlapped.