# assetBundleVariant

> Get or set the AssetBundle variant.

## Definition

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

```csharp
public string assetBundleVariant { get; set; }
```

### Remarks

This property has a value when the Asset is assigned to a specific variant of an AssetBundle, and corresponds to the second dropdown of the AssetBundle control found at the bottom of the Inspector. Its value is stored in the .meta file for the Asset, and inside the [AssetDatabase](/engine/6000.6/script-reference/unityeditor/assetdatabase.md).

This property is not used when AssetBundles are being built programmatically with the signature of [BuildPipeline.BuildAssetBundles](/engine/6000.6/script-reference/unityeditor/buildpipeline/buildassetbundles.md) that accepts an array of [AssetBundleBuild](/engine/6000.6/script-reference/unityeditor/assetbundlebuild.md) structures.

Additional Resources: [AssetImporter.assetBundleName](/engine/6000.6/script-reference/unityeditor/assetimporter/assetbundlename.md), [AssetBundleBuild.assetBundleVariant](/engine/6000.6/script-reference/unityeditor/assetbundlebuild/assetbundlevariant.md).

### Examples

```csharp
using UnityEngine;
using UnityEditor;
public class AssetBundleVariantExample : MonoBehaviour
{
    [MenuItem("Tools/AssetBundleVariantExample")]
    static void Example()
    {
        var importer = AssetImporter.GetAtPath("Path/To/Your/Asset");

        //Get asset bundle variant
        var assetBundleVariant = importer.assetBundleVariant;

        Debug.Log($"Asset bundle variant: {assetBundleVariant} for {importer.assetPath}");
        //Set asset bundle variant
        importer.assetBundleVariant = "new_asset_bundle_variant";
        //Save and reimport to apply changes
        importer.SaveAndReimport();
        Debug.Log($"Updated AssetBundleVariant to: {importer.assetBundleVariant} for: {importer.assetPath}");
    }
}
```
