unity-game-enginetextmeshpro

What is the difference between TMP_Text and TextMeshProUGUI?


While making a game with Unity, I was curious about the difference between TMP_Text and TextMeshProUGUI in TMPro. Please let me know what is different from each other. I'd appreciate an example of when to use it.

I don't know why TMP_Text and TextMeshProUGUI are separated and used separately in Unity.


Solution

  • TMP_Text is the base/parent class for two types

    So if you want to be more generic (loosely coupled) and make your component work in theory with whatever will be used for displaying that text later you use TMP_Text so both can be used the same way.