Transform t = GetComponent<Transform>();
print(t);
Collider[] colliders = GetComponents<Collider>();//获取所有的碰撞组件
foreach (Collider c in colliders)//遍历所有的碰撞组件
{
print(c);
}
print(GetComponent<BoxCollider>());//获取盒子碰撞器
print(GetComponent<Learn02_Player2>());//获取Learn02_Player2脚本
print(player.GetComponent<Rigidbody>());//获取刚体