Go out: http://gad.qq.com/article/detail/26562
1: This process is executed by CanvasUpdateRegistry monitoring Canvas's WillRenderCanvases (1 in the above figure), mainly to rebuild the layout and graphics previously marked as dirty. The main reason for the dirty layout and graphics is because the UI elements under the Canvas tree structure have changed (such as adding and deleting UI objects, UI element vertices, rec size changes, etc.) Graphic.SetDirty is called (in fact, CanvasUpdateRegistry will eventually be called) .RegisterCanvasElementForLayoutRebuild).
2: Before rebuilding the layout, the elements in the Layout rebuild queue will be sorted according to their hierarchical depth in the heiarchy (2 in the above figure). The result of the arrangement is that the nodes closer to the root will be preferentially processed.
3: rebuild layout (3 in the above figure), mainly to execute the methods in the ILayoutElement and ILayoutController interfaces to calculate the layout information such as the position and the size of the Rect.
4: rebulid graphic (4 in the above figure), mainly calling UpdateGeometry to reconstruct the vertex data of the mesh (5 in the above figure) and calling UpdateMeterial to update the material information of the CanvasRender (6 in the above figure).