| Parameter | Description |
|---|---|
| args | Optional arguments that Smart String placeholders format against. |
Awaitable<string> An awaitable that produces the formatted localized string, or an empty string when the reference is empty.
Resolves the localized string asynchronously, formatting it with the given arguments.
Loads the table through the ResourceDatabase provider chain if needed, formats Smart String placeholders
against the supplied arguments and LocalizedString.LocalVariables, and returns an empty string when the reference is
empty. When LocalizationSettings.PreferredLoading is LoadingPreference.Synchronous, it
resolves synchronously when the value is available and otherwise falls back to this asynchronous load.
<para>Resolve a string and format it with an argument.</para>
using Unity.Localization; using UnityEngine;
namespace Unity.Localization.Samples { public class LocalizedStringFormatAsyncExample { public async Awaitable Resolve() { var localizedString = new LocalizedString(); localizedString.SetReference("My Strings", "GREETING"); string playerName = "Sam"; string text = await localizedString.GetLocalizedStringAsync(playerName); Debug.Log(text); } } }