Version: 2021.2
言語: 日本語

GameObject

class in UnityEngine

/

継承:Object

マニュアルに切り替える

説明

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.

変数

activeInHierarchyDefines whether the GameObject is active in the Scene.
activeSelfゲームオブジェクトのローカルのアクティブ状態(読み取り専用)
isStaticGets and sets the GameObject's StaticEditorFlags.
layerThe layer the GameObject is in.
sceneゲームオブジェクトが属しているシーン
sceneCullingMaskScene culling mask Unity uses to determine which scene to render the GameObject in.
tagゲームオブジェクトのタグ
transformGameObject にアタッチされている Transform

コンストラクタ

GameObject name という名のゲームオブジェクトを作成します

Public 関数

AddComponentゲームオブジェクトに className という名のコンポーネントクラスを追加します
BroadcastMessageゲームオブジェクトまたは子オブジェクトにあるすべての MonoBehaviour を継承したクラスにある methodName 名のメソッドを呼び出します。
CompareTagこのゲームオブジェクトは tag とタグ付けされているかどうか
GetComponentゲームオブジェクトに type がアタッチされている場合は type のタイプを使用してコンポーネントを返します。ない場合は null です
GetComponentInChildren深さ優先探索でゲームオブジェクトまたはゲームオブジェクトの子たちの type からコンポーネントを取得します。
GetComponentInParentRetrieves the component of Type type in the GameObject or any of its parents.
GetComponentsゲームオブジェクトの type のすべてのコンポーネントを返します
GetComponentsInChildrenゲームオブジェクトまたはゲームオブジェクトの子たちから type のすべてのコンポーネントを取得します。
GetComponentsInParentゲームオブジェクトまたはその親たちから type のすべてのコンポーネントを返します
SendMessageゲームオブジェクトにアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します
SendMessageUpwardsゲームオブジェクトと親(の親、さらに親 ... )にアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します
SetActiveActivates/Deactivates the GameObject, depending on the given true or false value.
TryGetComponentGets the component of the specified type, if it exists.

Static 関数

CreatePrimitiveプリミティブメッシュレンダラーと適切なコライダーを作成します
Find name で GameObject を検索し返します。
FindGameObjectsWithTagReturns an array of active GameObjects tagged tag. Returns empty array if no GameObject was found.
FindWithTag/tag/でタグ付けされたアクティブなゲームオブジェクトを返します。もし見つからない場合は null を返します

継承メンバー

変数

hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameオブジェクト名

Public 関数

GetInstanceIDGets the instance ID of the object.
ToStringReturns the name of the object.

Static 関数

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeタイプ type から最初に見つけたアクティブのオブジェクトを返します
FindObjectsOfTypeGets a list of all loaded objects of Type type.
Instantiateoriginal のオブジェクトをクローンします

Operator

boolオブジェクトが存在するかどうか
operator !=二つのオブジェクトが異なるオブジェクトを参照しているか比較します
operator ==2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961