Hi,
I have a question regarding Auto Size in TMPText.
I have two buttons, each displaying text that changes at run time. My goal is to go through the buttons, pick the smallest font size, and set this font size to all buttons so that they have uniform font sizes.
However, determining the font size proves difficult. The Font Size of the relevant TMP Text Components return a - from my perspective - not yet updated value.
To Debug, i set a script with this text on one of my buttons:
private void OnEnable()
{
GetComponentInChildren<TMPro.TextMeshProUGUI>().text = "a really really long text text text text text text text text texttexttext";
float size = GetComponentInChildren<TMPro.TextMeshProUGUI>().fontSize;
Debug.Log(size);
}
I then toggle the button object manually and this is what happens:
The Font Size is properly set to 90.35 (text fits its button), but its not what is returned in my Debug-Code.
When I toggle the button again:

The value I expected is returned.
At what time in Unity’s order of method calls is “Font Size” applied?
Is there even such a thing?
I can put this Debug-Code in an Update method and at some point the change is made - but I am unable to pinpoint when exactly that happens, and so I do not know when to compare the different font sizes.
Insights into what is going on here would be much appreciated.
