Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


LocalizedEntry<TEntry>

A serializable reference to a single localization table entry that resolves to a typed entry value.
Read time 2 minutesLast updated 6 days ago

Definition

public class LocalizedEntry<TEntry> : LocalizedReference where TEntry : class, IResourceEntry

Remarks

A LocalizedEntry<TEntry> pairs the LocalizedReference.TableReference inherited from LocalizedReference with a TableEntryReference, then resolves the entry as
TEntry
. When LocalizedReference.EnableFallback is set, resolution follows the locale fallback chain. Lookups go through the ResourceDatabase provider chain: call LocalizedEntry<TEntry>.GetEntryAsync to load on demand, or LocalizedEntry<TEntry>.GetEntry() to read from already-loaded tables. The LocalizedString and LocalizedAsset<TObject> types derive from typed versions of this class. Read the raw entry directly to inspect variants or metadata that the higher-level types do not expose.
Resolve the raw entry for a reference and read its value.

Examples

using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class LocalizedEntryResolveExample { public async Awaitable Resolve() { var reference = new LocalizedString(); reference.SetReference("My Strings", "HELLO"); IStringEntry entry = await reference.GetEntryAsync(); if (entry != null) Debug.Log(entry.Value); } }}

Properties

Property

Description

IsEmptyWhether this reference is unset and resolves to no value.
TableEntryReferenceThe entry within the table collection that this reference resolves.

Methods

Method

Description

GetEntryResolves the entry synchronously from already-loaded tables without triggering a load.
GetEntryAsyncResolves the entry asynchronously, loading the table if it is not already available.
SetReferenceSets the table and entry references together so the reference refreshes only once.

Inheritance