# AssetKey(string, Type, string)

> Creates a key for the given address, interpreted by the active provider.

## Definition

* **Type:** Constructor
* **Namespace:** [Unity.Localization.Providers](/engine/6000.7/script-reference/unity/localization/providers.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

```csharp
public AssetKey(string address, Type type = null, string subAssetName = null)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The provider-specific address, for example a `Resources` path.**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): The expected asset type. Defaults to [Object](/engine/6000.7/script-reference/unityengine/object.md).**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The optional name of a sub-asset at the address.

### Remarks

An empty or null `address` produces a key whose [AssetKey.IsValid](/engine/6000.7/script-reference/unity/localization/providers/assetkey/isvalid.md) is `false`, which providers treat as a miss. When `type` is `null`, [AssetKey.Type](/engine/6000.7/script-reference/unity/localization/providers/assetkey/type.md) reports [Object](/engine/6000.7/script-reference/unityengine/object.md). Pass `subAssetName` to target a named sub-asset at the address, such as one sprite in a sheet.

Create a key for a whole asset and a key for a named sub-asset.

### Examples

```csharp
using Unity.Localization.Providers;
using UnityEngine;

namespace Unity.Localization.Samples
{
    public class AssetKeyConstructorExample
    {
        public void Run()
        {
            var icon = new AssetKey("UI/Icons/Settings", typeof(Sprite));
            var sheetEntry = new AssetKey("UI/Atlas", typeof(Sprite), "Settings");

            Debug.Log(icon.SubAssetName == null);   // True
            Debug.Log(sheetEntry.SubAssetName);     // Settings
        }
    }
}
```
