用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:gameobject:gameobject

GameObject 游戏对象

Namespace: UnityEngine Parent class: Object

Description 描述

Base class for all entities in Unity scenes.

Unity场景里面所有实体的基类。

See Also: Component.

Variables 变量

activeInHierarchyIs the GameObject active in the scene?
场景中的游戏对象是否激活?
activeSelfThe local active state of this GameObject. (Read Only)
该游戏对象的局部激活状态。(只读)
isStaticEditor only API that specifies if a game object is static.
如果一个游戏对象是静态仅在编辑器API指定。
layerThe layer the game object is in. A layer is in the range [0…31].
游戏对象所在的层,层的范围是在[0…31]之间。
sceneScene that the GameObject is part of.
场景物体。
tagThe tag of this game object.
这个游戏对象的标签。
transformThe Transform attached to this GameObject. (null if there is none attached).
附加于这个游戏对象上的变换。(如果没有则为空)

Constructors 构造器

GameObjectCreates a new game object, named name.
创建一个新的游戏物体,命名为name。

Functions 函数

AddComponentAdds a component class named /className/ to the game object.
添加一个名称为className的组件到游戏对象。
BroadcastMessageCalls the method named /methodName/ on every MonoBehaviour in this game object or any of its children.
对此游戏对象及其子对象的所有MonoBehaviour中调用名称为methodName的方法。
CompareTagIs this game object tagged with /tag/?
此游戏对象是否被标记为tag标签?
GetComponentReturns the component of Type /type/ if the game object has one attached, null if it doesn't.
如果这个游戏对象附件了一个类型为type的组件,则返回该组件,否则为空。
GetComponentInChildrenReturns the component of Type /type/ in the GameObject or any of its children using depth first search.
返回此游戏对象或者它的所有子对象上(深度优先)的类型为type的组件。
GetComponentInParentFinds component in the parent.
从父对象查找组件。
GetComponentsReturns all components of Type /type/ in the GameObject.
返回该游戏对象所有type类型的组件列表。
GetComponentsInChildrenReturns all components of Type /type/ in the GameObject or any of its children.
返回此游戏对象与其子对象所有type类型的组件。
GetComponentsInParentReturns all components of Type /type/ in the GameObject or any of its parents.
返回此游戏对象与其父对象所有type类型的组件。
script/unityengine/classes/gameobject/gameobject.txt · 最后更改: 2016/08/02 05:27 (外部编辑)