# ResourceEntryBase

> Serves as the base class for the built-in resource entry kinds, holding the stable key id and per-entry metadata.

## Definition

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

```csharp
public abstract class ResourceEntryBase : IResourceEntry
```

## Remarks

This class implements the storage that every entry kind shares: the KeyId that ties the entry to a shared key, and the Metadata for that entry. Concrete kinds add their value on top, for example [StringEntry](/engine/6000.7/script-reference/unity/localization/stringentry.md) for text or [AssetEntry](/engine/6000.7/script-reference/unity/localization/assetentry.md) for an object reference. Derive from this class (or from [AssetEntryBase\<TStore>](/engine/6000.7/script-reference/unity/localization/assetentrybase1.md)) to add a custom entry kind. Entries are stored polymorphically in a [ResourceTable](/engine/6000.7/script-reference/unity/localization/resourcetable.md), so a new kind needs no change to the table.

Additional Resources: [StringEntry](/engine/6000.7/script-reference/unity/localization/stringentry.md), [AssetEntryBase\<TStore>](/engine/6000.7/script-reference/unity/localization/assetentrybase1.md), [IResourceEntry](/engine/6000.7/script-reference/unity/localization/iresourceentry.md), [ResourceTable](/engine/6000.7/script-reference/unity/localization/resourcetable.md)

Read the shared members through a concrete string entry.

## Examples

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

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

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

            StringEntry entry = table.AddStringEntry("greeting", "Hello");

            ResourceEntryBase baseEntry = entry;  // StringEntry derives from ResourceEntryBase
            Debug.Log(baseEntry.KeyId);
            Debug.Log(baseEntry.Metadata.HasData);
        }
    }
}
```

## Constructors

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