How to prevent color changes when the text property of TextMeshPro is modified.
As you can see, I use a method to modify the text property of TextMeshPro, and immediately after the modification, I change its vertex color (red or white), and then use the ForceMeshUpdate method. However, the text still briefly returns to the default color (green) for a moment. I am currently aware that a series of methods are called when the text property is modified. I am investigating the cause of the problem in the source code. To avoid wasting too much time, I would like to ask if anyone has any ideas about such an issue?
public void ChangeText(string text)
{
if (m_textMeshPro != null)
{
m_textMeshPro.text = text;
UpdateTime(m_timeTemp); // set vertex color
m_textMeshPro.ForceMeshUpdate();
}
}
user24923965 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.