中文
Appearance
GameObject.AddComponent(type)
GameObject
根据组件类型为当前游戏对象添加组件。
Component
T|null
let go = new GameObject(); //为游戏对象添加一个BoxCollider组件 let com = go.AddComponent<BoxCollider>(BoxCollider);