# GetAssetPathsFromAssetBundleAndAssetName(string, string)

> Get the Asset paths for all Assets tagged with assetBundleName and named assetName.

## Definition

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

```csharp
public static string[] GetAssetPathsFromAssetBundleAndAssetName(string assetBundleName, string assetName)
```

### Parameters

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

### Returns

| Type                                                               | Description                                                                                 |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- |
| [string\[\]](https://learn.microsoft.com/dotnet/api/system.string) | An array of paths for all assets tagged with the specified AssetBundle name and asset name. |

### Remarks

This method returns assets regardless of extension or path. For example, `Assets/House.prefab`, `Assets/Textures/House.png` and `Assets/Data/House.xml` when `assetName` is `House`.

### Examples

```csharp
using UnityEditor;
using UnityEngine;

public class ExampleScript
{
    [MenuItem("AssetDatabase/Display assets in an AssetBundle")]
    static void ExampleScriptCode1()
    {
        string[] assetPaths = AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName("assetname", "House");
        foreach (var assetPath in assetPaths)
            Debug.Log(assetPath);
    }

    [MenuItem("AssetDatabase/AssetBundle creation")]
    static void ExampleScriptCode2()
    {
        BuildPipeline.BuildAssetBundles("Assets/AssetBundles", BuildAssetBundleOptions.None, BuildTarget.StandaloneOSX);
    }
}
```
