Hi, I’m having an issue with the latest TextMeshPro version (3.0.4) in the latest Unity release (2020.2.7). When I create a TMP UI component containing some tags then change the text at runtime, the linkInfo array never updates.
Here is a simple demo project: http://thomascastiglione.com/TMP-linkinfo-bug-demo.zip
The project contains the following script, which replaces the initial two links with one link and then none:
using System.Collections;
using TMPro;
using UnityEngine;
public class LinkModifier : MonoBehaviour
{
private TextMeshProUGUI textMeshPro;
void Start()
{
textMeshPro = GetComponent<TextMeshProUGUI>();
StartCoroutine(ModifyLinks());
}
void Update()
{
Debug.Log(textMeshPro.textInfo.linkInfo.Length);
}
IEnumerator ModifyLinks()
{
yield return new WaitForSeconds(2);
textMeshPro.text = "<link>Sole Link</link>";
yield return new WaitForSeconds(2);
textMeshPro.text = "";
}
}
Despite these modifications, the linkInfo doesn’t update, and Update() prints “2” every frame thereafter.