Hi i was just about to optimize my GUI since i was experiencing a few lags on android mobile.
Most of them were prefab instancing on mobile. (i reposted this, since i put it in the wrong category)
Anyway im using the latest 2019.4 Version & the latest TMPro package.
My GUI works like that: After a touch event i scale in (0,0,0 → 1,1,1) the GUI Window.
Sometimes there is an delay before i scale in the window.
The GUIs gameObject is always active and it has a CanvasGroup & Child-Canvas Object on it.
When i scale in the GUI instantly, without delay i dont get any spikes in the profiler.
But as soon as i add a frame delay (via delayed update() or StartCoroutine)
private IEnumerator _WaitForOneFrame(Action callNext)
{
// do some actions here
yield return null; // wait for 1 frames
callNext();
}
I get a spike in the profiler:
TextMeshProUGUI.InternalUpdate() - 96 calls 1156.64ms
TextMeshProUGUI.UpdateSDFScale() - 2 calls
…GenerateTextMesh() …
This Window has two TextMesh Monos, which seem to get regenerated, when i scale it in after a delay. Without delay all works fine.
I also tested this on Android.
I will do some more tests, fading it in, or moving it in does not trigger that.