- Home /
Question by
maximilianahead · Nov 05, 2021 at 04:33 PM ·
textperformanceperformance optimization
Optimization integer parameters with TextMeshPro
Hello,
For example, There is a formatted parameter display on every update.
{0} / {1}
A simple implementation would look like this.
tmp_health.text = $"{health} / {health_max}";
So, how much does this code benefit me?
tmp_health.SetCharArray(*This method can be used to assign integer values with zero allocations);
tmp_slash.text = "/"; // no every update
tmp_health_max.SetCharArray(*same);
There is a difference between be allocated or three elements used.
Thanks.
Comment
Your answer
Follow this Question
Related Questions
1 UI Text vs 2 UI Text 1 Answer
Optimizing Performance with tris 0 Answers
Hundreds of box colliders or 1 big mesh collider 1 Answer
Empty scene @ 60fps vs City Scene @140fps... ????? 0 Answers