Interface ITextProvider
- Namespace
- TDMaker.Unity.Localization
- Assembly
- TDMaker.Unity.dll
A source of user-visible text by key. TextTable assets implement it; implement it yourself to feed the HUD from another system (for example the Unity Localization package or a spreadsheet import) and assign it to Provider. Lookups happen when a label changes, not every frame, but should not allocate.
public interface ITextProvider
Methods
TryGetText(string, out string)
Looks up key. Returns false (or an empty text) when the provider has no text for it, so the resolver
falls back to the English text and then to the key itself. Texts may contain rich-text tags and
Format(string, object) placeholders ({0}, {1}) where the key expects numbers or names.
bool TryGetText(string key, out string text)