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
- Type: Class
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
- Inherits from: LocalizedReference
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 . 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.
TEntryAdditional Resources: LocalizedString, LocalizedAsset<TObject>, TableEntryReference, ResourceDatabase
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 |
|---|---|
| IsEmpty | Whether this reference is unset and resolves to no value. |
| TableEntryReference | The entry within the table collection that this reference resolves. |
Methods
Method | Description |
|---|---|
| GetEntry | Resolves the entry synchronously from already-loaded tables without triggering a load. |
| GetEntryAsync | Resolves the entry asynchronously, loading the table if it is not already available. |
| SetReference | Sets the table and entry references together so the reference refreshes only once. |