collider | 要检索其接触点的碰撞体。 |
colliders | 用于获取这些结果的 Collider2D 数组。 |
int
返回放置在 colliders
数组中的碰撞体数。
获取与 collider
接触的所有碰撞体。
当获取接触时,应确保提供的数组足够大,能够包含您感兴趣的所有接触。该数组一般会重用,因此其大小应能够返回合理数量的接触。此函数还意味着不发生分配,因此不需要垃圾回收器进行回收。
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
collider | 要检索其接触点的碰撞体。 |
contacts | 用于获取这些结果的 ContactPoint2D 数组。 |
int
返回放置在 contacts
数组中的接触数。
获取与 collider
接触的所有接触点。
Contacts involving a Collider2D set to be a trigger will never be returned here because trigger Colliders do not have contact points.
当获取接触时,应确保提供的数组足够大,能够包含您感兴趣的所有接触。该数组一般会重用,因此其大小应能够返回合理数量的接触。此函数还意味着不发生分配,因此不需要垃圾回收器进行回收。
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
collider | 要检索其接触点的碰撞体。 |
contactFilter | 接触筛选器,用于以不同方式筛选结果,例如按层遮罩、Z 深度或法线角度。 |
contacts | 用于获取这些结果的 ContactPoint2D 数组。 |
int
返回放置在 contacts
数组中的接触数。
获取与 collider
接触的所有接触点,其结果按 ContactFilter2D
进行筛选。
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.
当获取接触时,应确保提供的数组足够大,能够包含您感兴趣的所有接触。该数组一般会重用,因此其大小应能够返回合理数量的接触。此函数还意味着不发生分配,因此不需要垃圾回收器进行回收。
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
collider | 要检索其接触点的碰撞体。 |
contactFilter | 接触筛选器,用于以不同方式筛选结果,例如按层遮罩、Z 深度或法线角度。 |
colliders | 用于获取这些结果的 Collider2D 数组。 |
int
返回放置在 colliders
数组中的碰撞体数。
获取与 collider
接触的所有碰撞体,其结果按 ContactFilter2D
进行筛选。
当获取接触时,应确保提供的数组足够大,能够包含您感兴趣的所有接触。该数组一般会重用,因此其大小应能够返回合理数量的接触。此函数还意味着不发生分配,因此不需要垃圾回收器进行回收。
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
collider1 | 用于检查是否与 collider2 接触的碰撞体。 |
collider2 | 用于检查是否与 collider1 接触的碰撞体。 |
contactFilter | 接触筛选器,用于以不同方式筛选结果,例如按层遮罩、Z 深度或法线角度。 |
contacts | 用于获取这些结果的 ContactPoint2D 数组。 |
int
返回放置在 contacts
数组中的接触数。
获取 collider1
与 collider2
之间的接触的所有接触点,其结果按 ContactFilter2D
进行筛选。
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.
当获取接触时,应确保提供的数组足够大,能够包含您感兴趣的所有接触。该数组一般会重用,因此其大小应能够返回合理数量的接触。此函数还意味着不发生分配,因此不需要垃圾回收器进行回收。
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
rigidbody | 要检索其接触点的刚体。将检查附加到该刚体的所有碰撞体。 |
contacts | 用于获取这些结果的 ContactPoint2D 数组。 |
int
返回放置在 contacts
数组中的接触数。
检索与附加到该刚体的任何碰撞体接触的所有接触点。
Contacts involving a Collider2D set to be a trigger will never be returned here because trigger Colliders do not have contact points.
当获取接触时,应确保提供的数组足够大,能够包含您感兴趣的所有接触。该数组一般会重用,因此其大小应能够返回合理数量的接触。此函数还意味着不发生分配,因此不需要垃圾回收器进行回收。
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
rigidbody | 要检索其接触点的刚体。将检查附加到该刚体的所有碰撞体。 |
colliders | 用于获取这些结果的 Collider2D 数组。 |
int
返回放置在 colliders
数组中的碰撞体数。
检索与附加到该刚体的任何碰撞体接触的所有碰撞体。
当获取接触时,应确保提供的数组足够大,能够包含您感兴趣的所有接触。该数组一般会重用,因此其大小应能够返回合理数量的接触。此函数还意味着不发生分配,因此不需要垃圾回收器进行回收。
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
rigidbody | 要检索其接触点的刚体。将检查附加到该刚体的所有碰撞体。 |
contactFilter | 接触筛选器,用于以不同方式筛选结果,例如按层遮罩、Z 深度或法线角度。 |
contacts | 用于获取这些结果的 ContactPoint2D 数组。 |
int
返回放置在 contacts
数组中的接触数。
获取与附加到该刚体的任何碰撞体接触的所有接触点,其结果按 ContactFilter2D
进行筛选。
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.
当获取接触时,应确保提供的数组足够大,能够包含您感兴趣的所有接触。该数组一般会重用,因此其大小应能够返回合理数量的接触。此函数还意味着不发生分配,因此不需要垃圾回收器进行回收。
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
rigidbody | 要检索其接触点的刚体。将检查附加到该刚体的所有碰撞体。 |
contactFilter | 接触筛选器,用于以不同方式筛选结果,例如按层遮罩、Z 深度或法线角度。 |
colliders | 用于获取这些结果的 Collider2D 数组。 |
int
返回放置在 colliders
数组中的碰撞体数。
获取与附加到该刚体的任何碰撞体接触的所有碰撞体,其结果按 ContactFilter2D
进行筛选。
当获取接触时,应确保提供的数组足够大,能够包含您感兴趣的所有接触。该数组一般会重用,因此其大小应能够返回合理数量的接触。此函数还意味着不发生分配,因此不需要垃圾回收器进行回收。
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
collider | The Collider to retrieve contacts for. |
colliders | A list of Collider2D used to receive the results. |
void
Returns the number of Colliders placed in the colliders
list.
Retrieves all Colliders in contact with the collider
.
The integer return value is the number of results written into the results
list. 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.
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
collider | The Collider to retrieve contacts for. |
contactFilter | 接触筛选器,用于以不同方式筛选结果,例如按层遮罩、Z 深度或法线角度。 |
colliders | A list of Collider2D used to receive the results. |
void
Returns the number of Colliders placed in the colliders
list.
Retrieves all Colliders in contact with the collider
, with the results filtered by the contactFilter2D
.
The integer return value is the number of results written into the results
list. 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.
The results can also be filtered by the contactFilter
.
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
collider | The Collider to retrieve contacts for. |
contacts | A list of ContactPoint2D used to receive the results. |
void
Returns the number of contacts placed in the contacts
list.
获取与 collider
接触的所有接触点。
The integer return value is the number of results written into the results
list. 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.
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
collider | The Collider to retrieve contacts for. |
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 in contact with the collider
, with the results filtered by the contactFilter2D
.
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.
The integer return value is the number of results written into the results
list. 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.
The results can also be filtered by the contactFilter
.
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
collider1 | The Collider to check if it has contacts against collider2 . |
collider2 | The Collider to check if it has contacts against collider1 . |
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 in for contacts between with the collider1
and collider2
, with the results filtered by the contactFilter2D
.
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.
The integer return value is the number of results written into the results
list. 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.
The results can also be filtered by the contactFilter
.
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
rigidbody | The Rigidbody to retrieve contacts for. All Colliders attached to this Rigidbody will be checked. |
colliders | A list of Collider2D used to receive the results. |
void
Returns the number of Colliders placed in the colliders
list.
Retrieves all Colliders in contact with any of the Collider(s) attached to this Rigidbody.
The integer return value is the number of results written into the results
list. 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.
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
rigidbody | The Rigidbody to retrieve contacts for. All Colliders attached to this Rigidbody will be checked. |
contactFilter | 接触筛选器,用于以不同方式筛选结果,例如按层遮罩、Z 深度或法线角度。 |
colliders | A list of Collider2D used to receive the results. |
void
Returns the number of Colliders placed in the colliders
list.
Retrieves all Colliders in contact with any of the collider(s) attached to this Rigidbody, with the results filtered by the contactFilter2D
.
The integer return value is the number of results written into the results
list. 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.
The results can also be filtered by the contactFilter
.
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
rigidbody | The Rigidbody to retrieve contacts for. All Colliders attached to this Rigidbody will be checked. |
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 in contact with any of the Collider(s) attached to this Rigidbody.
Contacts involving a Collider2D set to be a trigger will never be returned here because trigger Colliders do not have contact points.
The integer return value is the number of results written into the results
list. 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.
The results can also be filtered by the contactFilter
.
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。
rigidbody | The Rigidbody to retrieve contacts for. All Colliders attached to this Rigidbody will be checked. |
contactFilter | Returns the number of contacts placed in the contacts list. |
contacts | A list of ContactPoint2D used to receive the results. |
void
Returns the number of contacts placed in the contacts
list.
Retrieves all Colliders in contact with any of the Collider(s) attached to this Rigidbody, with the results filtered by the contactFilter2D
.
The integer return value is the number of results written into the results
list. 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.
The results can also be filtered by the contactFilter
.
另请参阅:Collider2D.GetContacts 和 Rigidbody2D.GetContacts。