Hello,
I have a need to change the text of a text mesh pro UI text object and retrieve its textBounds to resize an object for a unit test. I have included Unity.TextMeshPro in the .asmdef file. I have tried multiple things like waiting for multiple frames, calling ForceMeshUpdate(), and even calling Canvas.ForceUpdateCanvases(), but the returned textBounds is always Center: (0.00, 0.00, 0.00), Extents: (-2147484000.00, -2147484000.00, 0.00). However, the text itself shows that it has changed to the correct string.
While doing the same thing in regular play mode, I just have to wait a frame after changing the text to get the correct textBounds. Is there something I’m missing to make this work in a Unity Play Mode Unit Test?