# LoadAssetWithSubAssets

> Loads Asset and sub Assets from the AssetBundle synchronously.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AssetBundleModule

## LoadAssetWithSubAssets(string)

Loads Asset and sub Assets from the AssetBundle synchronously.

```csharp
public Object[] LoadAssetWithSubAssets(string name)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Name of the Asset.

### Returns

| Type                                                                | Description |
| ------------------------------------------------------------------- | ----------- |
| [Object\[\]](/engine/6000.6/script-reference/unityengine/object.md) |             |

### Remarks

Load objects from the Asset and its SubAssets.  If the signatures that specify the type are called then the requested type is matched against the Main object and Visible objects in each Asset. Otherwise the main objects of each Asset is returned.  An example usage is to load all sprites from an sprite that uses "Multiple" for its [Sprite Mode](/engine/6000.6/manual/materials-and-shaders/textures/textures-reference/texture-type-sprite.md).

## LoadAssetWithSubAssets\<T>(string)

Loads Asset and sub Assets from the AssetBundle synchronously.

```csharp
public T[] LoadAssetWithSubAssets<T>(string name) where T : Object
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Name of the Asset.

### Returns

| Type              | Description |
| ----------------- | ----------- |
| [\<T>\[\]](./.md) |             |

### Remarks

Load objects from the Asset and its SubAssets.  If the signatures that specify the type are called then the requested type is matched against the Main object and Visible objects in each Asset. Otherwise the main objects of each Asset is returned.  An example usage is to load all sprites from an sprite that uses "Multiple" for its [Sprite Mode](/engine/6000.6/manual/materials-and-shaders/textures/textures-reference/texture-type-sprite.md).

## LoadAssetWithSubAssets(string, Type)

Loads Asset and sub Assets from the AssetBundle synchronously.

```csharp
public Object[] LoadAssetWithSubAssets(string name, Type type)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Name of the Asset.**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): Type to load.

### Returns

| Type                                                                | Description |
| ------------------------------------------------------------------- | ----------- |
| [Object\[\]](/engine/6000.6/script-reference/unityengine/object.md) |             |

### Remarks

Load objects from the Asset and its SubAssets.  If the signatures that specify the type are called then the requested type is matched against the Main object and Visible objects in each Asset. Otherwise the main objects of each Asset is returned.  An example usage is to load all sprites from an sprite that uses "Multiple" for its [Sprite Mode](/engine/6000.6/manual/materials-and-shaders/textures/textures-reference/texture-type-sprite.md).
