Render class diagram relationships in Unity
Render priority in UGUI systems
The display priorities fall into four categories
1. When Canvas is screenspace-overlay mode
In this mode, UGUI content is always displayed in front of all objects. The Canvas itself is rendered according to the order of precedence in Hireachy, and the different Canvas is determined by the sortinglayer value. All 3D objects are rendered under Canvas.
WorldSpace VS ScreenSpace mode
Canvas rendering depends on the z axis of the actual GameObject and its sorting order or order in Layer.
3. Non-overlay mode of SpriteRender and Canvas
When canvas is in WorldSpace and Screenspace-camera mode, it is basically equivalent to SpriteRenderer, and the rendering methods are consistent.
If SpriteRenderer is juxtised with WorldSpace and screenspace-overlay, it can be seen that the effect parameters and priority of any two rendering methods intersecting the SpriteRenderer are the same (i.e. the green background content in the mind map above). These three types can be collectively referred to as “flat rendered objects in three-dimensional space”.
4. MeshRender is compared with a three-dimensional space plane render object
MeshRender is not controlled by the sorting order but only by position.z. The smaller the z value, the higher it is displayed.