Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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

stringThe key text, or
null
when the id is absent.

Remarks

Returns
null
when the id is
0
or not present.
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); } }}