- Home /
Ui Effects components shadow and outline are creating tons of garbage
I am using te builtin shadow and outline components on a ui text gameObject. When I change the text of it, the effects run their ModifyMesh function from BaseMeshEffect class and create garbage everytime.
How can this be resolved?
Probably due to the graphics rebuild call every update? That is completely unnecessary and is obviously going to cause issues when generating a new mesh every frame. Are you perhaps calling to change the text every single frame? If so, this seems a bit excessive, and if it is some sort of Time counter you are using, then consider not using shadows on it? Basically every time you change the text, it has to rebuild a new mesh for the renderer, so... avoid this.
THank you for your comment. I only change the text if it needs to be changed, e.g. update a broadcast text if something has happened or the current ammo of the gun if I have fired it. However, these are often called and 0.6$$anonymous$$B for each call is a bit to much.