Draw.Text multiple times in same frame has same string?
Hi there,
Not sure if this is a known issue, but it seems like calling Shapes.Draw.Text() multiple times in the same frame results in the same string being drawn at each position.
Tried to reduce to a fairly simple test case, eg.
Camera.onPostRender += (Camera cam) => {
Draw.ResetAllDrawStates();
Draw.FontSize = 100;
Draw.TextAlign = TextAlign.Left;
Draw.Text(new Vector3(0, 0, 0), "Hello");
Draw.Text(new Vector3(0, 10, 0), "Goodbye");
};
I also tried adding a few extra "update yourself now" calls on the TMP object within Draw.Text() but the only thing that seemed to actually help was calling DestroyImmediate on the ShapesTextDrawer.Instance after each draw call.
I was originally on TMP 3.0.1, and upgraded to 3.0.3 but looks like it's still happening. Not sure if it's a newly introduced bug in TMP, or if there are now some extra things you need to do to flush if re-using the same TMP component's mesh in the same frame (since I noticed Shapes' min TMP version is 1.4.1)
well, that is super bizarre :c
it's almost certainly a bug on Unity's end then, though it would be nice if there was a workaround