You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than using Update and comparing properties every frame, this whole thing can be simplified using the TextMeshPro.OnPreRenderText event, which was purpose-built for modifications like this. Here's a forum post from the creator of TextMeshPro explaining why this event was added and how it covers this use case. Essentially you can make modifications to the vertices "just in time" and avoid calling ForceMeshUpdate and UpdateVertexData.
I have adapted this code and written a simpler version, which you can find here. My version:
Trims all the Update and property comparison logic using the OnPreRenderText event
Removes unnecessary properties arcDegrees and offsetAngle—if you want to increase the number of degrees the text arc occupies, use the pre-existing character spacing attributes on TextMeshPro, and if you want to control the angle of rotation, simply use a rotation on the z-axis of the parent transform
Does away with the inheritance scheme as I had no need for TextProOnAExp
Activity
bleppie commentedon Sep 17, 2024
Thank you, this is definitely cleaner.