# TryLoadAsset<T>(AssetKey, out T)

> Resolves the referenced asset for the key without an asynchronous load.

## Definition

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

## TryLoadAsset\<T>(AssetKey, T)

```csharp
public bool TryLoadAsset<T>(AssetKey key, out T asset) where T : Object
```

### Parameters

**** (\[AssetKey]\(/engine/6000.7/script-reference/unity/localization/providers/assetkey)): The asset to resolve.**** (T): The resolved asset, or `null` on a miss.

### Returns

| Type                                                          | Description                                        |
| ------------------------------------------------------------- | -------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` when the asset resolved; otherwise `false`. |

### Remarks

Returns `true` and the asset when the address is registered and the asset is a `T` (or matches [AssetKey.Type](/engine/6000.7/script-reference/unity/localization/providers/assetkey/type.md) when `T` is the base [Object](/engine/6000.7/script-reference/unityengine/object.md)); otherwise returns `false` with a `null` asset. Because the assets are already in memory, this provider only implements the synchronous capability.

Register a texture by address and resolve it back through the provider.

### Examples

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

namespace Unity.Localization.Samples
{
    public class ReferencedAssetProviderLoadAssetGenericExample
    {
        public void Run()
        {
            var provider = new ReferencedAssetProvider();
            provider.Add("UI/Logo", new Texture2D(2, 2));

            if (provider.TryLoadAsset<Texture2D>(new AssetKey("UI/Logo", typeof(Texture2D)), out var logo))
                Debug.Log(logo.name);
        }
    }
}
```
