オブジェクトの子も含めたアセットの配列を返します。これは依存関係にあるものすべてを取得します。これはゲームオブジェクトの階層全体を全てのコンポーネントを含めて直線化するのにもっとも役に立ちます
ディレクトリを跨いでアセットから参照されたオブジェクトのみは含まれないことに留意して下さい(階層にあるオブジェクトのみを取得します)。例えば MeshFilter コンポーネントが階層にあっても、参照されたメッシュは必ずしも結果リストに含まれません。
function Start () {
// Create two GameObjects.
var parent = new GameObject(); parent.name = "Parent";
var child = new GameObject(); child.name = "Child";
// Make one a child of the other.
child.transform.parent = parent.transform;
// Collect entire hierarchy.
var result = EditorUtility.CollectDeepHierarchy([parent]);
// Dump results. Will log four objects to the console;
// two GameObjects ("Parent" and "Child") and two Transform
// components (one belonging to "Parent" and one belonging to
// "Child").
for (var obj in result) {
Debug.Log(obj);
}
}