文档

Unity Engine

Unity Engine

otherRigidbody

The other Rigidbody2D involved in the collision with the Collision2D.rigidbody.
阅读时间1 分钟最后更新于 2 天前

Definition

public Rigidbody2D otherRigidbody { get; }

Remarks

This may be null if the Collision2D.otherCollider is not attached to a Rigidbody2D.
Additional Resources: Collider2D and Rigidbody2D.