附加到此 GameObject 的 Rigidbody(只读)。(如果未附加,则为 null)。
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { public GameObject other; public Rigidbody rb = other.GetComponent<Rigidbody>(); void Example() { rb.AddForce(1, 1, 1); } }