# AssetEntry

> Represents a localized asset stored as a direct object reference that ships and loads with the table.

## Definition

* **Type:** Class
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule
* **Inherits from:** [AssetEntryBase\<Object>](/engine/6000.7/script-reference/unity/localization/assetentrybase1.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 class AssetEntry : AssetEntryBase<Object>, IAssetEntry, IResourceEntry, ISynchronousAssetEntry
```

## Remarks

The asset is referenced directly through [AssetEntry.DirectAsset](/engine/6000.7/script-reference/unity/localization/assetentry/directasset.md), so it is included in the build and resolves without an asynchronous load. Use this kind for assets you want packed with the table, and use [ResourceAssetEntry](/engine/6000.7/script-reference/unity/localization/resourceassetentry.md) when the asset ships through a `Resources` folder instead. Add one to a table with [ResourceTable.AddEntry](/engine/6000.7/script-reference/unity/localization/resourcetable/addentry.md).

Additional Resources: [ResourceAssetEntry](/engine/6000.7/script-reference/unity/localization/resourceassetentry.md), [AssetEntryBase\<TStore>](/engine/6000.7/script-reference/unity/localization/assetentrybase1.md), [IAssetEntry](/engine/6000.7/script-reference/unity/localization/iassetentry.md), [ResourceTable](/engine/6000.7/script-reference/unity/localization/resourcetable.md)

Add a direct asset entry to a table and check its state.

## Examples

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

namespace Unity.Localization.Samples
{
    public class AssetEntryOverviewExample
    {
        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);

            Debug.Log(entry.HasAsset());   // False until DirectAsset is assigned
            Debug.Log(entry.DirectAsset);  // null
        }
    }
}
```

## Constructors

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

## Properties

| Property                                                                                    | Description                                   |
| ------------------------------------------------------------------------------------------- | --------------------------------------------- |
| [DirectAsset](/engine/6000.7/script-reference/unity/localization/assetentry/directasset.md) | The directly referenced asset for this entry. |

## Inheritance

**Inherited Members:**

* [AssetEntryBase\<Object>.HasValue(Object)](/engine/6000.7/script-reference/unity/localization/assetentrybase1/hasvalue.md)
* [AssetEntryBase\<Object>.TryLoadSync(Object, Object)](/engine/6000.7/script-reference/unity/localization/assetentrybase1/tryloadsync.md)
* [AssetEntryBase\<Object>.Release(Object, Object)](/engine/6000.7/script-reference/unity/localization/assetentrybase1/release.md)
* [AssetEntryBase\<Object>.Default()](/engine/6000.7/script-reference/unity/localization/assetentrybase1/default.md)
