Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

To canvas or not to canvas!

Discussion in 'UGUI & TextMesh Pro' started by Xtro, Sep 17, 2014.

  1. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    544
    What's the pros and cons of creating canvases for each window-like panel?
    Should I implement my all windows as panels in only one canvas or should I create multiple canvases with a panel in them.
     
  2. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Sounds like it's a good idea to stress test, I'm guessing canvases have an overhead, whereas their components probably have less of an overhead. So probably easier to have a root object for each group of objects or panels.
     
  3. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    500
    Seems like this area should be answered by the unity team. It also seems that eliminating child canvas's could be in the unity spirit of keeping things optimised behind the covers might be worth considering?
     
  4. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    According to what Unity has said, you should group as much as possible that is static (not being resized/animated/replaced regularly) in one or few canvases to encourage batching, and move volatile elements to their own canvas(es) so that as little recalculation per frame is happening as possible, but only if you are experiencing performance issues.
     
  5. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    544
    So, it looks like that we should use separate canvases for such windows which can be moved or resized...
     
  6. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    500
    Where did Unity say this?
     
  7. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    They had a "hangout" last week. It should be on the Unity YouTube channel.
     
  8. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Personally I would recommend that yes, but its also up to you on what you feel is best practise for your workflow.
     
  9. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    3,149
    In my head a UI Group that is linked to, but not part of another should be it's own canvas, especially if it replaces the first after a click or what not. I have zero idea about performance though.