contacts | 用于获取这些结果的 ContactPoint2D 数组。 |
int
返回放置在 contacts
数组中的接触数。
Retrieves all contact points for this Collider.
Contacts involving a Collider2D set to be a trigger will never be returned here because trigger Colliders do not have contact points.
您应传入一个大到足以包含您想要返回的所有接触的数组。这个数组一般会被重用,因此其大小应能够返回合理数量的接触。此函数不进行分配,这意味着不需要垃圾回收器进行回收。
另请参阅:Rigidbody2D.GetContacts 和 Physics2D.GetContacts。
colliders | 用于获取这些结果的 Collider2D 数组。 |
int
返回放置在 colliders
数组中的接触数。
Retrieves all colliders in contact with this Collider.
您应传入一个大到足以包含您想要返回的所有接触的数组。这个数组一般会被重用,因此其大小应能够返回合理数量的接触。此函数不进行分配,这意味着不需要垃圾回收器进行回收。
另请参阅:Rigidbody2D.GetContacts 和 Physics2D.GetContacts。
contactFilter | 接触筛选器,用于以不同方式筛选结果,例如按层遮罩、Z 深度或法线角度。 |
contacts | 用于获取这些结果的 ContactPoint2D 数组。 |
int
返回放置在 contacts
数组中的接触数。
Retrieves all contact points for this Collider, with the results filtered by the contactFilter
.
Contacts involving a Collider2D set to be a trigger will never be returned here because trigger Colliders do not have contact points. This is true even if the contactFilter
has its ContactFilter2D.useTriggers set to true.
您应传入一个大到足以包含您想要返回的所有接触的数组。这个数组一般会被重用,因此其大小应能够返回合理数量的接触。此函数不进行分配,这意味着不需要垃圾回收器进行回收。
另请参阅:Rigidbody2D.GetContacts 和 Physics2D.GetContacts。
contactFilter | 接触筛选器,用于以不同方式筛选结果,例如按层遮罩、Z 深度或法线角度。 |
colliders | 用于获取这些结果的 Collider2D 数组。 |
int
返回放置在 colliders
数组中的碰撞体数。
Retrieves all colliders in contact with this Collider, with the results filtered by the contactFilter
.
您应传入一个大到足以包含您想要返回的所有接触的数组。这个数组一般会被重用,因此其大小应能够返回合理数量的接触。此函数不进行分配,这意味着不需要垃圾回收器进行回收。
另请参阅:Rigidbody2D.GetContacts 和 Physics2D.GetContacts。
contacts | A list of ContactPoint2D used to receive the results. |
void
Returns the number of contacts placed in the contacts
list.
Retrieves all contact points for this Collider.
Contacts involving a Collider2D set to be a trigger will never be returned here because trigger Colliders do not have contact points.
The results list will be resized if it doesn't contain enough elements to report all the results. This prevents memory from being allocated for results when the results
list does not need to be resized, and improves garbage collection performance when the query is performed frequently.
另请参阅:Rigidbody2D.GetContacts 和 Physics2D.GetContacts。
colliders | A list of Collider2D used to receive the results. |
void
Returns the number of contacts placed in the colliders
list.
Retrieves all colliders in contact with this Collider.
The results list will be resized if it doesn't contain enough elements to report all the results.This prevents memory from being allocated for results when the results
list does not need to be resized, and improves garbage collection performance when the query is performed frequently.
另请参阅:Rigidbody2D.GetContacts 和 Physics2D.GetContacts。
contactFilter | 接触筛选器,用于以不同方式筛选结果,例如按层遮罩、Z 深度或法线角度。 |
contacts | A list of ContactPoint2D used to receive the results. |
void
Returns the number of contacts placed in the contacts
list.
Retrieves all contact points for this Collider, with the results filtered by the contactFilter
.
Contacts involving a Collider2D set to be a trigger will never be returned here because trigger Colliders do not have contact points.
The results list will be resized if it doesn't contain enough elements to report all the results. This prevents memory from being allocated for results when the results
list does not need to be resized, and improves garbage collection performance when the query is performed frequently.
另请参阅:Rigidbody2D.GetContacts 和 Physics2D.GetContacts。
contactFilter | 接触筛选器,用于以不同方式筛选结果,例如按层遮罩、Z 深度或法线角度。 |
colliders | A list of Collider2D used to receive the results. |
void
Returns the number of contacts placed in the colliders
list.
Retrieves all colliders in contact with this Collider, with the results filtered by the contactFilter
.
The results list will be resized if it doesn't contain enough elements to report all the results. This prevents memory from being allocated for results when the results
list does not need to be resized, and improves garbage collection performance when the query is performed frequently.
另请参阅:Rigidbody2D.GetContacts 和 Physics2D.GetContacts。