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
Rather than using
Update
and comparing properties every frame, this whole thing can be simplified using theTextMeshPro.OnPreRenderText
event, which was purpose-built for modifications like this. Here's a forum post from the creator ofTextMeshPro
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 callingForceMeshUpdate
andUpdateVertexData
.I have adapted this code and written a simpler version, which you can find here. My version:
Update
and property comparison logic using theOnPreRenderText
eventarcDegrees
andoffsetAngle
—if you want to increase the number of degrees the text arc occupies, use the pre-existing character spacing attributes onTextMeshPro
, and if you want to control the angle of rotation, simply use a rotation on the z-axis of the parent transformTextProOnAExp