ドキュメント

Unity Engine

Unity Engine

GetRootGameObjects

Returns all the root game objects in the Scene.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

GetRootGameObjects()

Returns all the root game objects in the Scene.
public GameObject[] GetRootGameObjects()

Returns

Type

Description

GameObject[]An array of game objects.

GetRootGameObjects(List<GameObject>)

Returns all the root game objects in the Scene.
public void GetRootGameObjects(List<GameObject> rootGameObjects)

Parameters

rootGameObjects

A list which is used to return the root game objects.

Remarks

Please make sure the list capacity is bigger than Scene.rootCount, then Unity will not allocate memory internally.