기술 자료

Unity Engine

Unity Engine

GetRootGameObjects

Returns all the root game objects in the Scene.
읽는 시간 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.