TextMeshPro Integration
Requirements: TextMeshPro package installed
Components:
LocalizedTMP
Auto-updates TextMeshPro text components.
Setup:
- Select a GameObject with
TMP_Text(orTextMeshProUGUI) - Click Add Component → Localized TMP
- Configure the
LocalizedStringin Inspector - (Optional) Enable Use Locale Font for per-language fonts
csharp
public class LocalizedTMP : MonoBehaviour
{
LocalizedString LocalizedString { get; set; }
bool UseLocaleFont { get; set; }
void SetArguments(params object[] args);
void ClearArguments();
void Refresh();
}Per-Locale Fonts:
Configure fonts in your Locale settings:
- Select
LocalizationSettings - Expand a locale in Supported Locales
- Assign a
TMP_FontAssetto the Font field
LocalizedFontComponent
Localizes TMP fonts using the Asset Table system.
csharp
public class LocalizedFontComponent : MonoBehaviour
{
LocalizedFont LocalizedFont { get; }
bool RestoreOriginalOnDisable { get; set; }
void SetFontReference(string tableId, string key);
void RestoreOriginalFont();
}