Serves as the base class for the built-in resource entry kinds, holding the stable key id and per-entry metadata.
This class implements the storage that every entry kind shares: the ResourceEntryBase.KeyId that ties the entry to a
shared key, and the ResourceEntryBase.Metadata for that entry. Concrete kinds add their value on top, for example
StringEntry for text or AssetEntry for an object reference. Derive from this class (or
from AssetEntryBase<T0>) to add a custom entry kind. Entries are stored polymorphically in a
ResourceTable, so a new kind needs no change to the table.
Additional resources: StringEntry, AssetEntryBase<T0>, IResourceEntry, ResourceTable
<para>Read the shared members through a concrete string entry.</para>
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); } } }