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

LocalizedEntry<T0>.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 TEntry GetEntry();

Returns

TEntry The resolved entry, or null when it is not available synchronously.

Description

Resolves the entry synchronously from already-loaded tables without triggering a load.

The entry is resolved as TEntry. The result is null when the required table is not loaded, the reference is empty, no resource database is configured, or the entry cannot be found. Use LocalizedEntry<T0>.GetEntryAsync to load the table on demand instead. The resolved entry is cached and reused until the reference changes or the resolving locale changes.

<para>Read an entry from an already-loaded table.</para>

using Unity.Localization;
using UnityEngine;

namespace Unity.Localization.Samples { public class LocalizedEntryGetEntryExample { public void Read() { var reference = new LocalizedString(); reference.SetReference("My Strings", "HELLO"); var entry = reference.GetEntry(); if (entry != null) Debug.Log(entry.Value); } } }