# ISynchronousAssetProvider

> An optional capability for an asset provider that can resolve an asset immediately, without an asynchronous load.

## Definition

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

```csharp
public interface ISynchronousAssetProvider
```

## Remarks

Implement this alongside [IAssetProvider](/engine/6000.7/script-reference/unity/localization/providers/iassetprovider.md) when a provider already has the asset in hand, such as a direct reference or a synchronous `Resources` load, so the localization system can resolve it on the synchronous paths (the `GetTable`/`GetLocalizedString`/`GetLocalizedAsset` accessors, and references resolved under the [LoadingPreference.Synchronous](/engine/6000.7/script-reference/unity/localization/loadingpreference/synchronous.md) loading preference). A provider that can only load asynchronously does not implement this interface; the synchronous paths skip it and fall back to whatever is already cached. A Unity [Awaitable](/engine/6000.7/script-reference/unityengine/awaitable.md) cannot be forced to complete on the main thread, so this interface is how a provider opts in to synchronous resolution rather than blocking one.

Additional Resources: [IAssetProvider](/engine/6000.7/script-reference/unity/localization/providers/iassetprovider.md), [ResourceDatabase](/engine/6000.7/script-reference/unity/localization/resourcedatabase.md)

A provider that keeps assets in memory and resolves them synchronously.

## Examples

```csharp
using System.Collections.Generic;
using Unity.Localization.Providers;
using Object = UnityEngine.Object;

namespace Unity.Localization.Samples
{
    public class SyncAssetProviderExample : IAssetProvider, ISynchronousAssetProvider
    {
        readonly Dictionary<string, Object> m_Assets = new();

        public void Register(string address, Object asset) => m_Assets[address] = asset;

        public bool TryLoadAsset<T>(AssetKey key, out T asset) where T : Object
        {
            asset = m_Assets.TryGetValue(key.Address, out var value) ? value as T : null;
            return asset != null;
        }

        public void Release(Object asset) { }
    }
}
```

## Methods

| Method                                                                                                                 | Description                                                          |
| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [TryLoadAsset](/engine/6000.7/script-reference/unity/localization/providers/isynchronousassetprovider/tryloadasset.md) | Tries to resolve the asset for a key without loading asynchronously. |
