# GetAssetPathsFromAssetBundle(string)

> Returns an array containing the paths of all assets marked with the specified AssetBundle name.

## Definition

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

```csharp
public static string[] GetAssetPathsFromAssetBundle(string assetBundleName)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the AssetBundle.

### Returns

| Type                                                               | Description |
| ------------------------------------------------------------------ | ----------- |
| [string\[\]](https://learn.microsoft.com/dotnet/api/system.string) |             |

### Remarks

All paths returned are relative to the project folder, for example: "Assets/MyTextures/hello.png" will be returned if "hello.png" has been added to an Asset Bundle.

### Examples

```csharp
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class GetAssetPathsFromAssetBundleExample : MonoBehaviour
{
    [MenuItem("APIExamples/GetAssetPathsFromAssetBundle")]
    static void GatherAllAssetsInAssetBundles()
    {
        string[] allAssetBundles = AssetDatabase.GetAllAssetBundleNames();

        List<string> allAssetsInAnAssetBundle = new List<string>();
        for (int i = 0; i < allAssetBundles.Length; ++i)
        {
            var curBundleName = allAssetBundles[i];
            var assetsInCurBundle = AssetDatabase.GetAssetPathsFromAssetBundle(curBundleName);

            allAssetsInAnAssetBundle.AddRange(assetsInCurBundle);
        }

        //allAssetsInAnAssetBundle now contains all assets that belong to an asset bundle
    }
}
```
