ドキュメント

Unity Engine

Unity Engine

GetSourceValue(ISelectorInfo)

Resolves this string so it can be read as a Smart String placeholder in another string.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: Unity.Localization
  • Assembly: UnityEngine.LocalizationRuntimeModule
public object GetSourceValue(ISelectorInfo selector)

Parameters

Describes the placeholder being resolved.

Returns

Type

Description

ObjectThe resolved text, or an empty string when the reference is unset or the nesting limit is reached.

Remarks

Add a LocalizedString to another string's LocalizedString.LocalVariables to embed one entry inside another. The nested string reads its own variables layered over the containing string's (a chained scope). Two entries that reference each other resolve as empty and log a warning rather than recursing without end.
Embed one localized string inside another as a local variable.

Examples

using Unity.Localization;namespace Unity.Localization.Samples{ public class LocalizedStringNestedExample { public void Nest() { var localizedString = new LocalizedString(); localizedString.SetReference("My Strings", "TITLE"); var nested = new LocalizedString(); nested.SetReference("My Strings", "SUBTITLE"); localizedString.LocalVariables.Add(nested, "subtitle"); } }}