GetEntry
Returns the entry for a key.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
GetEntry(string)
Returns the entry for a key.
public SharedTableData.SharedTableEntry GetEntry(string key)
Parameters
The key to look up.
Returns
Type | Description |
|---|---|
| SharedTableEntry | The matching entry, or |
Remarks
Returns when the key is empty, null, or not present. The entry exposes the key's id, flags, and metadata through SharedTableData.SharedTableEntry.
nullAdditional Resources: SharedTableData.GetEntry, SharedTableData.GetId
Look up an entry by its key text.
Examples
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); } }}
GetEntry(long)
Returns the entry for a stable id.
public SharedTableData.SharedTableEntry GetEntry(long id)
Parameters
The id to look up.
Returns
Type | Description |
|---|---|
| SharedTableEntry | The matching entry, or |
Remarks
Returns when no key uses the id. An id of means "no key" and always resolves to .
null0nullAdditional Resources: SharedTableData.GetEntry, SharedTableData.GetKey
Look up an entry by its stable id.
Examples
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 } }}