Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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

SharedTableEntryThe matching entry, or
null
when the key is absent.

Remarks

Returns
null
when the key is empty, null, or not present. The entry exposes the key's id, flags, and metadata through SharedTableData.SharedTableEntry.
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

SharedTableEntryThe matching entry, or
null
when the id is absent.

Remarks

Returns
null
when no key uses the id. An id of
0
means "no key" and always resolves to
null
.
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 } }}