Would it be possible to get an event when the TextMeshProUGUI text has changed? I am aware this might add a small performance penalty, so perhaps also add a way to not raise it if not set.
This will allow me to add custom text animations and other features and not care which component changed the text, either the localization plugin, or some other custom script.
To modify the incoming text, you could consider creating a script implementing the ITextPreprocessor which was added recently.
/// <summary>
/// Interface used for preprocessing and shaping of text.
/// </summary>
public interface ITextPreprocessor
{
/// <summary>
/// Function used for preprocessing of text
/// </summary>
/// <param name="text">Source text to be processed</param>
/// <returns>Processed text</returns>
string PreprocessText(string text);
}
There should be a few posts about this on the forum.
2 Likes