Organizing your UI for Performance in Unity

Unity Profiler Course

There usually is two types of UI in our scene, one that does not change throughout the lifetime of the game while another which changes its values.

Generating these meshes can be expensive. UI elements need to be collected into batches so that they’re drawn in as few draw calls as possible. Because batch generation is expensive, we want to regenerate them only when necessary. The problem is that, when one or more elements change on a Canvas, the whole Canvas has to be re-analyzed to figure out how to optimally draw its elements.

So its a best practice to create two separate canvas or mainly separate the UI that changes and UI which does not. It will allow the unity to regenerate only those elements inside active canvas while static canvas remains unchanged saving CPU usage and improving performance.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store