Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

SharedTableData.GetEntry

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public SharedTableEntry GetEntry(string key);

Parameters

Parameter Description
key The key to look up.

Returns

SharedTableEntry The matching entry, or null when the key is absent.

Description

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); } } }

Declaration

public SharedTableEntry GetEntry(long id);

Parameters

Parameter Description
id The id to look up.

Returns

SharedTableEntry The matching entry, or null when the id is absent.

Description

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 } } }