Class ChooseFormatter
Provides the ability to add logic to a Smart String by selecting an output using a provided set of choices.
Inherited Members
Namespace: UnityEngine.Localization.SmartFormat.Extensions
Assembly: Unity.Localization.dll
Syntax
[Serializable]
public class ChooseFormatter : FormatterBase, IFormatter, ISerializationCallbackReceiver, IFormatterLiteralExtractor
Constructors
Name | Description |
---|---|
ChooseFormatter() | Creates a new instance of the formatter. |
Properties
Name | Description |
---|---|
DefaultNames | |
SplitChar | The character used to split the choices. By default this is the pipe chartacter |. |
Methods
Name | Description |
---|---|
TryEvaluateFormat(IFormattingInfo) | Writes the current value to the output, using the specified format. IF this extension cannot write the value, returns false, otherwise true. |
WriteAllLiterals(IFormattingInfo) | Ignores the format arguments and writes every possible literal value. This is used to extract all possible values so that we can determine the distinct characters for font generation etc. |