Search Unity

OnGUI optimizations, or do I really need to redo it all?

Discussion in 'Immediate Mode GUI (IMGUI)' started by laurentlavigne, May 31, 2020.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    The game's UI relies a lot on OnGUI, not one loop with 100 same items, no, many different GetStyles layered on top of each other.
    Nothing uses GUILayout off course and guilayout=false where it matters, but that was back in 4.7, 6 years old stuff.
    So I was wondering what optimizations you guys use and also if something substantial was done in more recent version of unity to speed up ongui at runtime. (more recent than 2017 to which I already ported the beast)
     
  2. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    231
    I'm also interested in this as GUI is pretty slow. Even the scene view spends more time drawing the GUI than the whole scene in my case.