| Parameter | Description |
|---|---|
| key | The key to look up. |
SharedTableEntry
The matching entry, or null when the key is absent.
Returns the entry for a key.
Returns null when the key is empty, null, or not present. The entry exposes the key's id, flags,
and metadata through SharedTableEntry.
Additional resources: SharedTableData.GetEntry, SharedTableData.GetId
<para>Look up an entry by its key text.</para>
using Unity.Localization; using UnityEngine;
namespace Unity.Localization.Samples { public class SharedTableDataGetEntryByKeyExample { public void Run() { var sharedData = ScriptableObject.CreateInstance<SharedTableData>(); sharedData.AddKey("GREETING");
SharedTableData.SharedTableEntry entry = sharedData.GetEntry("GREETING"); Debug.Log(entry.Id); } } }
| Parameter | Description |
|---|---|
| id | The id to look up. |
SharedTableEntry
The matching entry, or null when the id is absent.
Returns the entry for a stable id.
Returns null when no key uses the id. An id of 0 means "no key" and always resolves
to null.
Additional resources: SharedTableData.GetEntry, SharedTableData.GetKey
<para>Look up an entry by its stable id.</para>
using Unity.Localization; using UnityEngine;
namespace Unity.Localization.Samples { public class SharedTableDataGetEntryByIdExample { public void Run() { var sharedData = ScriptableObject.CreateInstance<SharedTableData>(); long id = sharedData.AddKey("GREETING").Id;
SharedTableData.SharedTableEntry entry = sharedData.GetEntry(id); Debug.Log(entry.Key); // GREETING } } }