# AssetEntryBase<TStore>

> Serves as the base class for asset entries that own a stored reference and load and release the asset themselves.

## Definition

* **Type:** Class
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule
* **Inherits from:** [ResourceEntryBase](/engine/6000.7/script-reference/unity/localization/resourceentrybase.md)
* **Implements:** [IAssetEntry](/engine/6000.7/script-reference/unity/localization/iassetentry.md), [IResourceEntry](/engine/6000.7/script-reference/unity/localization/iresourceentry.md), [ISynchronousAssetEntry](/engine/6000.7/script-reference/unity/localization/isynchronousassetentry.md)

```csharp
public abstract class AssetEntryBase<TStore> : ResourceEntryBase, IAssetEntry, IResourceEntry, ISynchronousAssetEntry
```

## Remarks

The type parameter is the stored reference the entry keeps in [AssetEntryBase\<TStore>.Default](/engine/6000.7/script-reference/unity/localization/assetentrybase1/default.md), and each concrete kind decides how that reference resolves to an asset: [AssetEntry](/engine/6000.7/script-reference/unity/localization/assetentry.md) stores a direct object, and [ResourceAssetEntry](/engine/6000.7/script-reference/unity/localization/resourceassetentry.md) stores a `Resources` path. The built-in kinds are synchronous: they resolve through [ISynchronousAssetEntry.TryLoadAsset](/engine/6000.7/script-reference/unity/localization/isynchronousassetentry/tryloadasset.md), and public callers use the [IAssetEntry](/engine/6000.7/script-reference/unity/localization/iassetentry.md) members HasAsset and ReleaseAsset. To add a custom kind, override the protected `HasValue`, `TryLoadSync`, and `Release` members to back a different storage, such as an Addressables handle provided by a package.

Additional Resources: [AssetEntry](/engine/6000.7/script-reference/unity/localization/assetentry.md), [ResourceAssetEntry](/engine/6000.7/script-reference/unity/localization/resourceassetentry.md), [IAssetEntry](/engine/6000.7/script-reference/unity/localization/iassetentry.md), [ResourceTable](/engine/6000.7/script-reference/unity/localization/resourcetable.md)

Read the base members through a concrete asset entry.

## Examples

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

namespace Unity.Localization.Samples
{
    public class AssetEntryBaseOverviewExample
    {
        public void Run()
        {
            var shared = ScriptableObject.CreateInstance<SharedTableData>();
            shared.TableCollectionName = "UI Assets";

            var table = ScriptableObject.CreateInstance<ResourceTable>();
            table.SharedData = shared;
            table.LocaleIdentifier = new LocaleIdentifier("en");

            var entry = new AssetEntry(shared.AddKey("icon").Id);
            table.AddEntry(entry);

            AssetEntryBase<Object> baseEntry = entry;  // AssetEntry derives from AssetEntryBase<Object>
            Debug.Log(baseEntry.HasAsset());  // False: no asset assigned
            Debug.Log(baseEntry.Default);     // null
        }
    }
}
```

## Constructors

| Constructor                                                                                                                          | Description                    |
| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------ |
| [AssetEntryBase\`1()](/engine/6000.7/script-reference/unity/localization/assetentrybase1/ctor.md#assetentrybase\(\))                 | Creates an empty entry.        |
| [AssetEntryBase\`1(System.Int64)](/engine/6000.7/script-reference/unity/localization/assetentrybase1/ctor.md#assetentrybase\(long\)) | Creates an entry for a key id. |

## Properties

| Property                                                                                 | Description                                           |
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| [Default](/engine/6000.7/script-reference/unity/localization/assetentrybase1/default.md) | The stored reference this entry loads its asset from. |

## Methods

| Method                                                                                           | Description                                                                                  |
| ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
| [HasValue](/engine/6000.7/script-reference/unity/localization/assetentrybase1/hasvalue.md)       | Returns whether the given stored reference holds a value.                                    |
| [Release](/engine/6000.7/script-reference/unity/localization/assetentrybase1/release.md)         | Releases an asset that was loaded from a stored reference.                                   |
| [TryLoadSync](/engine/6000.7/script-reference/unity/localization/assetentrybase1/tryloadsync.md) | Resolves the asset from the given stored reference synchronously, when the kind supports it. |
