ドキュメント

Unity Engine

Unity Engine

GetContactColliders(ContactFilter2D, Allocator)

Retrieves all colliders in contact with this Collider, with the results filtered by the contactFilter.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
public ColliderArray2D GetContactColliders(ContactFilter2D contactFilter, Allocator allocator = Allocator.Temp)

Parameters

contactFilter

The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle.

allocator

The memory allocator to use for the results. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.

Returns

Type

Description

ColliderArray2DA collection of Collider2D containing the results. The collection does not allocate any managed memory but must be disposed of.