I’m working on a script that uses the tag for creating custom “tags”. While working on this I noticed that when the contents of the text box changes (textMeshPro.text), the contents of “textMeshPro.textInfo.linkInfo” doesn’t get cleared. This can cause some unexpected behavior, in my case:
- I have some text which contains parts that I’d like to animate using for example <link=“wave”>. In my code I go through the links stored inside textMeshPro.textInfo.linkInfo and handle them accordingly (in my case, animate the <link=“wave”> enclosed characters with a wave effect). However, problems arise when the text is changed to something that has no or fewer links than the previous text since this means that in this case some of the previous links are still present inside textMeshPro.textInfo.linkInfo. In my case, this meant that previous tags were affecting the new text.
For me, it’s possible to fix this in code (example: by using the linkCount to not go beyond the number of links that are in the current text) but I feel like this might be unwanted behavior in TextMeshPro? Or is it supposed to be this way.