Quantcast
Channel: Latest Questions by guto-thomas
Viewing all articles
Browse latest Browse all 84

UI rebuilding every frame after Unity 2017 upgrade

$
0
0
Since I updated my project from Unity 5.6 to 2017.2.0b11, my User Interface has turned into a huge bottleneck. My canvas is basically composed of 2D elements that target some 3D object, making the 2D UI stay on top of the 3D object. I noticed that `LayoutRebuilder.Rebuild` is getting called 90 times every frame, eating up to 200Kb of memory. It seems that the UI is getting redrawn every frame even if no major changes have been made to it. I also noticed that if I remove the **ContentSizeFitter** component from my prefab, the performance goes back to normal, but I'd like to keep it in the prefab, since it plays an important role. My UI element has the following components: **ContentSizeFitter** **VerticalLayoutGroup(for the parented items)** **LayoutElement** I have approximately 20 of these in my canvas. Before updating to 2017, the performance was normal. Here's a screenshot from the Profiler: ![alt text][1] PS:. This seems to be an issue exclusive to the Editor. When building the scene, the problem disappears. Should I report this as a bug? Thanks in advance! [1]: /storage/temp/102383-profiler.png

Viewing all articles
Browse latest Browse all 84

Latest Images

Trending Articles





Latest Images