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

SharedTableEntry

class in Unity.Localization

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

Description

A single key in the shared data, pairing the key text with its stable id.

Each entry carries the key's id, its text, the per-key SharedEntryFlags, and a MetadataCollection shared across every locale. Obtain one from SharedTableData.GetEntry or SharedTableData.AddKey rather than constructing it directly, so the owning SharedTableData keeps its id and key lookups in sync.

Additional resources: SharedTableData, SharedEntryFlags, MetadataCollection

<para>Read the id, key, and flags from an entry.</para>

using Unity.Localization;
using UnityEngine;

namespace Unity.Localization.Samples { public class SharedTableEntryOverviewExample { public void Run() { var sharedData = ScriptableObject.CreateInstance<SharedTableData>(); SharedTableData.SharedTableEntry entry = sharedData.AddKey("GREETING"); entry.IsSmart = true;

Debug.Log(entry.Id); Debug.Log(entry.Key); // GREETING Debug.Log(entry.Flags); // Smart } } }

Properties

Property Description
Flags Per-key flags shared across every locale.
Id The stable id of the key.
IsSmart Whether the key's string values are Smart Strings.
Key The key text.
Metadata Metadata attached to the key across every locale.