I am making an RTS game which currently has a very heavy GUI and takes up sometimes 50% of the CPU time per frame. Most of the data on the GUI remains constant, (selected units and their avalible actions) but some needs to be updated frequently (health bars, progress bars).

Is it possible to draw the GUI once on an event and then keep that on screen and only redraw parts of the GUI?

  • \$\begingroup\$ How do you change the stuff behind the GUI without redrawing it? \$\endgroup\$
    – Bálint
    Feb 12, 2018 at 10:50
  • 1
    \$\begingroup\$ Canvas should be relatively quick. You should look into optimizing your sprite/texture atlases Unity generates, having little texture swaps helps with performance. Also consider using multiple canvases for those that do not change so their Vertex Buffer Object doesn't change either ( no upload required ). \$\endgroup\$
    – Sidar
    Feb 12, 2018 at 11:08
  • 1
    \$\begingroup\$ Sorry I don't have time to summarize this video, but this guy has a lot of insight into optimizing Unity UI: youtube.com/watch?v=_wxitgdx-UI \$\endgroup\$
    – Ed Marty
    Feb 12, 2018 at 15:51


You must log in to answer this question.

Browse other questions tagged .