GameObject

class in UnityEngine

Cambiar al Manual

Descripción

Base class for all entities in Unity Scenes.

Note: Many variables in the GameObject class have been removed. To access, for example GameObject.renderer in csharp use GetComponent<Renderer>() instead.

See Also: Component.

Variables

activeInHierarchyDefines whether the GameObject is active in the Scene.
activeSelfEl estado activo local de este GameObject. (Solo lectura)
isStaticGets and sets the GameObject's StaticEditorFlags.
layerThe layer the game object is in.
sceneEscena de la que forma parte el GameObject.
sceneCullingMaskScene culling mask Unity uses to determine which scene to render the GameObject in.
tagEl tag de este game object.
transformEl Transform adjuntado a este GameObject.

Constructores

GameObjectCrea un nuevo game object, llamado name.

Funciones Públicas

AddComponentAgrega una clase componente llamada className al game object.
BroadcastMessageLlama al método denominado methodName de todos los MonoBehaviour en este game objecto en cualquiera de sus hijos.
CompareTag¿Este game object está etiquetado con tag?
GetComponentDevuelve un componente de tipo type si el game object tiene a alguno adjuntado, o null si no lo tiene.
GetComponentInChildrenDevuelve el componente del tipo type en el GameObject o en alguno de sus hijos usando búsqueda de primero en profundidad.
GetComponentInParentRetrieves the component of Type type in the GameObject or any of its parents.
GetComponentsDevuelve todos los componentes del tipo type en el GameObject.
GetComponentsInChildrenDevuelve todos los componentes del tipo type en el GameObject, o alguno de sus hijos.
GetComponentsInParentDevuelve todos los componentes del tipo type en el GameObject o en alguno de sus padres.
SendMessageLlama al método denominado methodName en cada MonoBehaviour de este game object.
SendMessageUpwardsLlama al método denominado methodName en todos los MonoBehaviour de este juego y en todos los ancestros del behaviour.
SetActiveActivates/Deactivates the GameObject, depending on the given true or false value.
TryGetComponentGets the component of the specified type, if it exists.

Funciones Estáticas

CreatePrimitiveCrea un game object con un mesh renderer primitivo y un collider apropiado.
FindEncuentra un GameObject por el name y lo retorna.
FindGameObjectsWithTagReturns an array of active GameObjects tagged tag. Returns empty array if no GameObject was found.
FindWithTagDevuelve un GameObject activo etiquetado con tag. Devuelve null si ningún GameObject fue encontrado.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961