Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Application.Update whenever changing STM rect/size

A topic by mgsanders created Jul 27, 2021 Views: 160 Replies: 1
Viewing posts 1 to 2

Had STM for a week now and I'm overall very happy with all the cool features. I have however noticed very long Application.Update and Application.UpdateScene loading bars whenever changing elements on the STM script or any parent rect transforms (up to 2/3 minutes). I've tested with other UI elements (such as standard text and textmeshpro) and haven't gotten the same results.

This is most noticeable on STM elements with large strings.

I just want to check that I'm not missing an option that keeps the editor from refreshing or anything?

Developer

Hmm does the text mesh have any animating text on it? If so, Super Text Mesh calls SetMesh() every frame... Usually a game will only have one large text box at a time that will have animated text, so this is normal.

But if you're just talking about in-editor... I have some code that forces Super Text Mesh to call Rebuild() (a heavier call than SetMesh() ) whenever the size of its rectTransform changes. This is also invoked upon OnValidate(), and OnEnable() which could be why it's being called when parent rectTransforms change. Both the rectTransform size and OnValidate behaviours are for ease-of-use in-editor, and don't actually run in a built game. These two are called under STM's Update() cycle and could potentially be commented out?)

If the text mesh does have animated elements, this might be effecting performance, too...

I could potentially add a toggle in the future to stop STM from auto-rebuilding in-editor, because I can see how it would be kind of annoying for larger text boxes...

I hope this information helps! A feature like this could be useful to have... if I'm understanding the problem correctly, haha.