# GetCoreUnityAssetPackNames()

> Gets the names of the core Unity asset packs built for this application that use the fast-follow or on-demand delivery type.

## Definition

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

```csharp
public static string[] GetCoreUnityAssetPackNames()
```

### Returns

| Type                                                               | Description                                                                                                                                                                                                                                                                           |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [string\[\]](https://learn.microsoft.com/dotnet/api/system.string) | An array of asset pack names for core Unity asset packs with the fast-follow or on-demand delivery type. An empty array if Unity didn't create any core asset packs with these delivery types, or if the [PlayCore plug-in](https://developer.android.com/guide/playcore) is missing. |

### Remarks

Core Unity asset packs are asset packs that Unity creates automatically when it builds the Android app bundle. Unity creates core asset packs only when you enable **Split Application Binary** in Android Player settings.

This method uses PlayCore APIs, therefore it can only return names of asset packs that use the fast-follow or on-demand delivery types. If this method returns an empty array, to differentiate between the two potential causes, check the [AndroidAssetPacks.coreUnityAssetPacksDownloaded](/engine/6000.6/script-reference/unityengine/android/androidassetpacks/coreunityassetpacksdownloaded.md) property.

You can pass the asset pack names that this method returns to other methods such as [AndroidAssetPacks.GetAssetPackStateAsync](/engine/6000.6/script-reference/unityengine/android/androidassetpacks/getassetpackstateasync.md) or [AndroidAssetPacks.DownloadAssetPackAsync](/engine/6000.6/script-reference/unityengine/android/androidassetpacks/downloadassetpackasync.md) to get status information or to start the download. However, calling [AndroidAssetPacks.RemoveAssetPack](/engine/6000.6/script-reference/unityengine/android/androidassetpacks/removeassetpack.md) with the names returned by this method has no effect.

### Examples

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

public class GetCoreUnityAssetPackNamesExample : MonoBehaviour
{
    IEnumerator Start()
    {
        if (AndroidAssetPacks.coreUnityAssetPacksDownloaded)
        {
            Debug.Log("All core Unity asset packs are already available.");
            yield break;
        }

        var corePackNames = AndroidAssetPacks.GetCoreUnityAssetPackNames();

        if (corePackNames.Length == 0)
        {
            Debug.LogError("No core asset packs found. The PlayCore plugin might be missing.");
            yield break;
        }

        // Check the state of each core asset pack.
        var stateOperation = AndroidAssetPacks.GetAssetPackStateAsync(corePackNames);
        yield return stateOperation;

        if (stateOperation.states == null)
        {
            Debug.LogError("Failed to retrieve core asset pack states.");
            yield break;
        }

        // Filter to only packs that are not yet installed.
        var packsToDownload = new List<string>();
        foreach (var state in stateOperation.states)
        {
            if (state.status == AndroidAssetPackStatus.NotInstalled)
            {
                packsToDownload.Add(state.name);
            }
            else
            {
                Debug.Log($"Core pack {state.name}: {state.status}");
            }
        }

        if (packsToDownload.Count > 0)
        {
            Debug.Log($"Downloading {packsToDownload.Count} core asset pack(s)...");
            yield return AndroidAssetPacks.DownloadAssetPackAsync(packsToDownload.ToArray());
        }

        Debug.Log($"Core Unity asset packs downloaded: {AndroidAssetPacks.coreUnityAssetPacksDownloaded}");
    }
}
```
