1. 获取物体的 GetComponentspa
playerRigidbody = GetComponent<Rigidbody> ();
GetComponent<Animatro> ();
2. MonoBehaviour 内部经常使用方法code
void Awake() { } // 该方法用于脚本刚建立的时候,用于初始化,能够引用其余物体,可是不能引用其余脚本,不能做为协程打开。 void Update() { } //在每次渲染前调用