Version: 2022.1
言語: 日本語

Collision2D

class in UnityEngine

マニュアルに切り替える

説明

Collision details returned by 2D physics callback functions.

The collisions details are returned by MonoBehaviour.OnCollisionEnter2D, MonoBehaviour.OnCollisionStay2D and MonoBehaviour.OnCollisionExit2D callbacks. It details which Collider2D and Rigidbody2D pairs are involved in the collision as well as contact points where the Collider2D meet.

変数

colliderThe incoming Collider2D involved in the collision with the otherCollider.
contactCountGets the number of contacts for this collision.
contactsThe specific points of contact with the incoming Collider2D. You should avoid using this as it produces memory garbage. Use GetContact or GetContacts instead.
enabledIndicates whether the collision response or reaction is enabled or disabled.
gameObject衝突してきたゲームオブジェクト
otherColliderThe other Collider2D involved in the collision with the collider.
otherRigidbodyThe other Rigidbody2D involved in the collision with the rigidbody.
relativeVelocity衝突した 2 つのオブジェクトの相対的な速度(読み取り専用)
rigidbodyThe incoming Rigidbody2D involved in the collision with the otherRigidbody.
transform衝突してきたオブジェクトの Transform

Public 関数

GetContactGets the contact point at the specified index.
GetContactsRetrieves all contact points for contacts between collider and otherCollider.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961