# GetLocalizedAssetAsync<TObject>(TableReference, TableEntryReference, Locale, CancellationToken)

> Resolves a localized asset: the direct reference when present, otherwise through the provider chain.

## Definition

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

## GetLocalizedAssetAsync\<T>(TableReference, TableEntryReference, Locale, CancellationToken)

```csharp
public Awaitable<TObject> GetLocalizedAssetAsync<TObject>(TableReference tableRef, TableEntryReference entryRef, Locale locale = null, CancellationToken cancellationToken = default) where TObject : Object
```

### Parameters

**** (\[TableReference]\(/engine/6000.7/script-reference/unity/localization/tablereference)): The reference to the table collection that holds the entry.**** (\[TableEntryReference]\(/engine/6000.7/script-reference/unity/localization/tableentryreference)): The reference to the asset entry to resolve within the table.**** (\[Locale]\(/engine/6000.7/script-reference/unity/localization/locale)): The locale to resolve in; null uses the selected locale.**** (\[CancellationToken]\(https\://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)): The token that cancels the load operation.

### Returns

| Type                                                                      | Description                                                                     |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| [Awaitable\<T>](/engine/6000.7/script-reference/unityengine/awaitable.md) | The loaded localized asset, or null when the entry has no asset for the locale. |

### Remarks

The entry resolves in the requested locale, following the fallback chain when it has no asset. The loaded asset is cached per locale and variant, so a matching entry is loaded once and reused. Release cached assets with [ResourceDatabase.ReleaseAssets](/engine/6000.7/script-reference/unity/localization/resourcedatabase/releaseassets.md) or [ResourceDatabase.ReleaseAllAssets](/engine/6000.7/script-reference/unity/localization/resourcedatabase/releaseallassets.md) when they are no longer needed.

Loads a localized sprite for the selected locale.

### Examples

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

namespace Unity.Localization.Samples
{
    public class GetLocalizedAssetAsyncExample : MonoBehaviour
    {
        async void Start()
        {
            Sprite flag = await LocalizationSettings.ResourceDatabase
                .GetLocalizedAssetAsync<Sprite>("UI Assets", "flag");
            Debug.Log(flag != null ? flag.name : "no flag");
        }
    }
}
```
