- Home /
How to access a sprite from Sprite Asset in Text Mesh Pro through script?
Hey everyone,
I got it to work perfectly from the inspector using tags. However, I can't seem to figure out how I can access that through script. I'm basically loading a high score with an icon, so I just wanted to add the icon string in the code to be added with the high score text.
Do you have to populate the Sprite Asset field under Extra Settings on the TextMeshPro gameObject to be able to do this?
In the tags as far as I know you don't need to, you can look for the texture atlas and then get the sprite by name usually something like this:
<sprite="MyTextureAtlas" name="MyTextureAtlas_0">
Thanks and I appreciate your help :)
Comment