Search Unity

What's CanvasUpdate?

Discussion in 'UGUI & TextMesh Pro' started by StarManta, Aug 27, 2014.

  1. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    What's the enum in the UI namespace called CanvasUpdate? It links to the Canvas clas but doesn't appear to be used there.
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    It's used by the CanvasUpdateRegistry. We don't have this extensively covered in documentation yet, but feel free to play with it.

    Basically when we are about to render canvases we do:
    • Layout
    • Rebuild Canvas Graphics
    During normal update ect we don't actually update verts / materials we just register them with the UpdateRegistry, deferring the work till the last moment. You can register things with the UpdateRegistry and receive callbacks, only register things that have changed :)
     
  3. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,932
    @Tim-C Is this still true? And is there a way to listen for the "rebuild canvas graphics"?

    Because - despite extensive googling, and reading the (largely non-existent) docs for Canvas*, and reading the source code as bst I could (all the stuff in C#, but the extern stuff obviously I don't have access to) I can't seem to find a reliable callback for "canvas finished doing layout".
     
    GuirieSanchez likes this.
  4. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,932