Search Unity

Unity UI 700 UI inside the canvas

Discussion in 'UGUI & TextMesh Pro' started by Ber92, Aug 4, 2017.

  1. Ber92

    Ber92

    Joined:
    Apr 13, 2015
    Posts:
    26
    Hello,

    I am developing a 2D game for Mobile, in my scene I have 500 UI elements, in the old cell phones the game goes very slow, the phone gets very hot, there are some ways to increase the performance of UIs?

    Edit:
    Profiler Result:
    Fps: 48
    CPU ms: 18
    GPU ms: 17
     
  2. Strangiato

    Strangiato

    Joined:
    Oct 24, 2014
    Posts:
    18
    Divide your scene up using subcanvases.

    Any time one UI element changes, all of your vertex buffers have to be recalculated, which includes comparing every element in the canvas for overlap with every other element. If you divide your one canvas with 500 elements into 20 canvas with 25 elements each, this processing will be much faster, and only the canvas that have an element that changed will have to be rebuilt each frame.
     
    Ber92 likes this.
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    Ber92 likes this.
  4. Ber92

    Ber92

    Joined:
    Apr 13, 2015
    Posts:
    26
    In my scene I have these elements:

    1) All background UI images
    2) ScrollRectNum1 with a mask, inside I have 20 UI images (card) with 12 other UI images
    3) ScrollRectNum2 with a mask, inside I have 60 UI images (card) with 12 other UI images inside

    Do I have to put the sub-Canvas on each card? Or should I put the sub-Canvas in the groups 1-2 and 3 above?
     
  5. Ber92

    Ber92

    Joined:
    Apr 13, 2015
    Posts:
    26
    help pls