GetKey(long)
Returns the key text for a stable id.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Method
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
public string GetKey(long id)
Parameters
The id to look up.
Returns
Type | Description |
|---|---|
| string | The key text, or |
Remarks
Returns when the id is or not present.
null0Additional Resources: SharedTableData.GetId, SharedTableData.GetEntry
Resolve a stable id back to its key text.
Examples
using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class SharedTableDataGetKeyExample { public void Run() { var sharedData = ScriptableObject.CreateInstance<SharedTableData>(); long id = sharedData.AddKey("GREETING").Id; string key = sharedData.GetKey(id); // GREETING Debug.Log(key); } }}