-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Description
Problem statement
Many people use TMPro.text = string, which is not optimal.
TMPro has a .SetText method to set text. This is as fast for set text, and it can provide garbage free float additions, which is not possible with manual setting
Documentation: https://docs.unity3d.com/ja/Packages/com.unity.textmeshpro@3.0/api/TMPro.TMP_Text.SetText.html
Proposed solution
When TMPro.text = string is detected, upgrade to .SetText(string)
When said string has variable numbers, like .text = $"Number: {value}", upgrade to .SetText("Number: {{0}, value")
When said string is made from a stringbuilder in the lines above without modification, pass the stringbuilder into the .SetText variable
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels