文档

Unity Engine

Unity Engine

rigidbody2D

The Rigidbody2D component attached to this GameObject. (Read Only)
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
警告
Removed. Property rigidbody2D has been deprecated. Use GetComponent\<Rigidbody2D\>() instead.
public Component rigidbody2D { get; }

Remarks

This property will be null if no Rigidbody2D is attached.
Additional Resources: GameObject.rigidbody.