Search Unity

UI optimizations (all-in-one Canvas)

Discussion in 'UIElements' started by SplashFoxGames, May 30, 2019.

  1. SplashFoxGames

    SplashFoxGames

    Joined:
    Oct 10, 2012
    Posts:
    45
    Good day, dear friends!

    I'd like to ask an advice on how to optimize UI structure.

    So I have everything on 1 Canvas, there are tens of screens with sub screens with tens of elements (Images/buttons/etc) inside each, something like that:

    Canvas
    ...GameScreen
    .......Container
    .......... Button
    .......... Button
    .......SubGameScreen
    ...........Container
    ..............Button
    ..............Button
    ...........SubSubGameScreen
    .................Container
    ....................Button
    ....................Button
    .......SubGameScreen
    ..........

    Its very easy to work in this way as I have folders structure done same way, so its a huge tree but well structured.
    But as you can see, when you go deeper in the tree - there is a situation when 3-5 screens are overlaying each others and it cause FPS drop on mobile devices (even after 2-3 screens overlap), there are lot of images with transparency...
    So how I can optimize it?
    my thoughts:
    1). When I open a SubScreen - I can make "Container" of prev. screen disabled - that will not auto-hide this child, but will remove stuff from rendering/calculations?
    2). Add CanvasGroup to screens?
    3). Make it linear, put on different canvases? Canvas in Canvas or completely separate nodes in scene root?
    Thanks in advance!
     
  2. wbahnassi_unity

    wbahnassi_unity

    Unity Technologies

    Joined:
    Mar 12, 2018
    Posts:
    18
    Last edited: May 30, 2019