# CollectInSceneAssets

> Gets information about in-scene assets referenced by the given GameObjects or scene.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

## CollectInSceneAssets(GameObject\[])

Gets information about in-scene assets referenced by the given GameObjects or scene.

```csharp
public static InSceneAssetInformation[] CollectInSceneAssets(GameObject[] gameObjects)
```

### Parameters

**** (\[GameObject\[]]\(/engine/6000.7/script-reference/unityengine/gameobject)): The GameObjects to traverse and collect in-scene asset references for.

### Returns

| Type                                                                                                  | Description                                                                                                            |
| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| [InSceneAssetInformation\[\]](/engine/6000.7/script-reference/unityeditor/insceneassetinformation.md) | Information about the in-scene assets referenced by the provided GameObjects or the GameObjects of the provided scene. |

### Remarks

Checks the entire hierarchy of each provided GameObject or GameObjects of the provided scene, their respective child GameObjects, and components to collect all in-scene assets referenced by them.

Additional Resources: [InSceneAssetInformation](/engine/6000.7/script-reference/unityeditor/insceneassetinformation.md).

## CollectInSceneAssets(Scene)

Gets information about in-scene assets referenced by the given GameObjects or scene.

```csharp
public static InSceneAssetInformation[] CollectInSceneAssets(Scene scene)
```

### Parameters

**** (\[Scene]\(/engine/6000.7/script-reference/unityengine/scenemanagement/scene)): The scene to traverse and collect in-scene asset references for.

### Returns

| Type                                                                                                  | Description                                                                                                            |
| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| [InSceneAssetInformation\[\]](/engine/6000.7/script-reference/unityeditor/insceneassetinformation.md) | Information about the in-scene assets referenced by the provided GameObjects or the GameObjects of the provided scene. |

### Remarks

Checks the entire hierarchy of each provided GameObject or GameObjects of the provided scene, their respective child GameObjects, and components to collect all in-scene assets referenced by them.

Additional Resources: [InSceneAssetInformation](/engine/6000.7/script-reference/unityeditor/insceneassetinformation.md).
