Version: Unity 7.0 Alpha (7000.0)
Language : English
Create a property visitor with low-level APIs
Introduction to Smart Strings

Generate dynamic text

Smart Strings are a Unity port of the SmartFormat library. They’re an alternative to String.Format for text that has to change at runtime, such as a score readout, a notification, or a line of dialog. Because the logic lives in the template rather than in your C# code, a designer or translator can edit the text without touching a script.

A Smart String is made of literal text and placeholders. Sources evaluate a placeholder to produce a value, and formatters convert that value into text.

Topic Description
Introduction to Smart Strings Understand how Smart Strings format dynamic text using named placeholders, sources, and formatters.
Configure Smart Strings Set up a project-wide default formatter and customize Smart Strings formatting in code.
Smart Strings settings reference Customize the settings that control the project’s default Smart String formatter.
Handle formatting errors Control how Smart Strings react to invalid format strings, and track the failures that happen.
Smart Strings performance Reduce allocations and re-parsing when you format the same Smart String repeatedly, and understand the thread-safety constraints of a formatter.
Populate strings with data using Sources Browse the sources that evaluate a placeholder’s selectors to produce the value to format.
Use formatters to apply logic to strings Browse the formatters that convert a selected value into text in a Smart String.

Additional resources

Create a property visitor with low-level APIs
Introduction to Smart Strings