Smart Strings settings reference
Customize the settings that control the project's default Smart String formatter, including case sensitivity, error handling, and the active sources and formatters.
Read time 3 minutesLast updated 5 days ago
Customize the settings that control the project's default Smart String formatter, including case sensitivity, error handling, and the active sources and formatters.
Open these settings from the main menu (Edit > Project Settings > Smart Strings), or by selecting a Smart Strings Settings asset in the Project window. The first time you open the page, select Create to make a settings asset. The settings define the default SmartFormatter reached at runtime through , and the asset is included in player builds. To set these values in code instead, refer to Configure Smart Strings.
Smart.ProjectSmart Strings settings
The Smart Strings settings contain the following sections.
Settings
Setting | Description |
|---|---|
| Case Sensitivity | Determines how selector and formatter names are matched. The following options are available:
|
Parser
Setting | Description |
|---|---|
| Error Action | Sets how the parser responds to an invalid format string. The following options are available:
|
| Convert Character String Literals | Interprets character escapes such as |
| Custom Selector Chars | Lists extra characters allowed in selectors, beyond letters, digits, |
| Custom Operator Chars | Lists extra characters treated as selector operators, in addition to |
Formatter
Setting | Description |
|---|---|
| Error Action | Sets how a formatter responds when it can't format a value. Has the same options as the parser Error Action, and defaults to Throw Error. Refer to Handle formatting errors. |
| Alignment Fill Character | Sets the character used to pad a value to its alignment width, for example |
Sources
The Sources list holds the sources the formatter tries, in order, to evaluate a placeholder's selectors. The order matters: each source is tried from the top until one handles the selector.
- Select Add (+) to choose a source type from the menu of available ISource implementations.
- Select Remove (−) to remove the selected source.
- Drag a source by its handle to reorder it.
Formatters
The Formatters list holds the formatters the formatter tries, in order, to convert a value to text. As with sources, the order matters for implicitly applied formatters.
- Select Add (+) to choose a formatter type from the menu of available IFormatter implementations.
- Select Remove (−) to remove the selected formatter.
- Drag a formatter by its handle to reorder it.