Hello,
Here is my problem: I need to use the cachedTextGenerator of a text inside a canvas to know its number of lines.
When I place a canvas in the scene, it works fine and I’m able to get the number of lines (using Canvas.ForceUpdateCanvases) from the cachedTextGenerator of the text.
But when i instantiate the canvas from a prefab, the cachedTextGenerator seems to give wrong informations. The string is correctly displayed on the canvas, but the cachedTextGenerator.lineCount always returns 0 (as well as the characterCount or any other thing in the cachedTextGenerator).
I’m probably missing something, does someone have an idea?
Thank you in advance.