# GetRootAssets

> Retrieve all root assets from all registered content directories.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Loading](/engine/6000.7/script-reference/unity/loading.md)
* **Assembly:** UnityEngine.ContentLoadModule

## GetRootAssets()

Retrieve all root assets from all registered content directories.

```csharp
public static Object[] GetRootAssets()
```

### Returns

| Type                                                                | Description                                                            |
| ------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [Object\[\]](/engine/6000.7/script-reference/unityengine/object.md) | An array of all the root assets in all registered content directories. |

## GetRootAssets(ContentDirectoryHandle)

Retrieve all root assets from the specified content directory.

```csharp
public static Object[] GetRootAssets(ContentDirectoryHandle contentDirectory)
```

### Parameters

**** (\[ContentDirectoryHandle]\(/engine/6000.7/script-reference/unity/loading/contentdirectoryhandle)): The registered content directory handle from which to retrieve root assets.

### Returns

| Type                                                                | Description                                                         |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| [Object\[\]](/engine/6000.7/script-reference/unityengine/object.md) | An array of all the root assets in the specified content directory. |

## GetRootAssets\<T>()

Retrieve all root assets of a specific type from all registered content directories.

```csharp
public static T[] GetRootAssets<T>() where T : Object
```

### Returns

| Type              | Description                                            |
| ----------------- | ------------------------------------------------------ |
| [\<T>\[\]](./.md) | An array of root assets that match the specified type. |

## GetRootAssets\<T>(ContentDirectoryHandle)

Retrieve all root assets of a specific type from the specified content directory.

```csharp
public static T[] GetRootAssets<T>(ContentDirectoryHandle contentDirectory) where T : Object
```

### Parameters

**** (\[ContentDirectoryHandle]\(/engine/6000.7/script-reference/unity/loading/contentdirectoryhandle)): The registered content directory handle from which to retrieve root assets.

### Returns

| Type              | Description                                            |
| ----------------- | ------------------------------------------------------ |
| [\<T>\[\]](./.md) | An array of root assets that match the specified type. |
