GameObject和gameobject之间的区别

来源:互联网 发布:京都特色民宿酒店知乎 编辑:程序博客网 时间:2024/04/30 07:02


GameObject is a type of object and acts as a base class for most Unity entities. It refers to the GameObject stored by unity which holds all Component data related to a GameObject (such as the Transform), the name and various other things.

gameObject is a local variable of type GameObject which is inherited from Component. It allows one to access the instance of the GameObject to which this component is attached.

gameObject

is in most cases functionally the same as

GetComponent("GameObject") as GameObject
0 0