GameObject
- GameObject 类在unity中是所有场景中物体(包括摄像机,光源等)的一个基础类,所有在hierarchy下新建的物体都是GameObject。
Transform
Transform 是 GameObject 的一个组件,它控制着一个 GameObject 物体的位置、旋转、大小(position,rotation,and scale)。
Transform 类是 Component 类的一个继承类(Inherits from: Component)继承了 Component 类的所有方法和成员变量(functions and variables)
GameObject.transform
GameObject.transform 是要获取添加在GameObject物体上的Transform组件。示例:
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { public GameObject other; void</