# LoadAllAssetRepresentationsAtPath(string)

> Obtains all sub-assets at assetPath.

## Definition

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

```csharp
public static Object[] LoadAllAssetRepresentationsAtPath(string assetPath)
```

### Parameters

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

### Returns

| Type                                                                | Description                            |
| ------------------------------------------------------------------- | -------------------------------------- |
| [Object\[\]](/engine/6000.5/script-reference/unityengine/object.md) | Returns all sub-assets at `assetPath`. |

### Remarks

This method only returns sub-assets that are visible in the Project view.

All paths are relative to the project folder, for example: "Assets/MyTextures/hello.png"

**Note**: Sub-assets can be added explicitly via [AssetDatabase.AddObjectToAsset](/engine/6000.5/script-reference/unityeditor/assetdatabase/addobjecttoasset.md)

Additional Resources: [AssetDatabase.LoadMainAssetAtPath](/engine/6000.5/script-reference/unityeditor/assetdatabase/loadmainassetatpath.md), [AssetDatabase.LoadAllAssetsAtPath](/engine/6000.5/script-reference/unityeditor/assetdatabase/loadallassetsatpath.md), [HideFlags.HideInHierarchy](/engine/6000.5/script-reference/unityengine/hideflags/hideinhierarchy.md).

### Examples

```csharp
using UnityEngine;
using UnityEditor;

public class Example : MonoBehaviour
{
    [MenuItem("AssetDatabase/LoadAllAssetRepresentationsAtPath")]
    private static void PrintSubAssets()
    {
        Object[] data = AssetDatabase.LoadAllAssetRepresentationsAtPath("Assets/MySpriteTexture.png");

        Debug.Log(data.Length + " Sub Assets");

        foreach (Object o in data)
        {
            Debug.Log(o);
        }

        // outputs:
        //  4 Sub Assets
        //  MyTexture_0 (UnityEngine.Sprite)
        //  MyTexture_1 (UnityEngine.Sprite)
        //  MyTexture_2 (UnityEngine.Sprite)
        //  MyTexture_3 (UnityEngine.Sprite)
    }
}
```
