cs-util-com / cscore

cscore is a minimal-footprint library providing commonly used helpers & patterns for your C# projects. It can be used in both pure C# and Unity projects.
https://cs-util-com.github.io/cscore/
Apache License 2.0
183 stars 31 forks source link

Switch entirely to Textmesh Pro #108

Open cs-util opened 11 months ago

cs-util commented 11 months ago

Many of the UI components that cscore provides still use the old TextMesh and since its considered deprecated switch over entirely for all of these to Textmesh Pro. This would ensure performance improvements of all UIs and also better readability of the text elements. Please add a comment if you see any potential drawbacks with this.

The best backwards compatible way to do this that would not break existing projects using the current approach would be to introduce new prefabs that the current presenters could just switch to transparently.

And Textmesh Pro has to be added as a mandatory new dependency of cscore to the Unity manifest, which should be fine.

The main code change that would be needed is to extend the UI Link map with returning for text objects a generic wrapper interface (or maybe there is already a common interface between the Text and TextMesh Pro text classes?). That approach would also allow developers who currently use the UI Link map for their own UIs to switch to text mesh Pro in their own UI prefabs at any time without having to change their code.

ThemeColor is another cscore component that needs to learn to work not only with Text instances but also with TextMesh Pro instances. The .ApplyColor method needs to be extended to support it.

I will prepare a draft on a new branch to make that idea more clear but won’t implement it for now.