One, the use of Ngui people know that the various Ngui sprite can be dept to the hierarchical management, in order to deal with the relationship between levels, and in the unity4.6 start Ugui, this is through the canvas to set the depth of the relationship between the
I designed three canvas in development to handle different types of UI messages
Staticcanvas
Touchormousecanvas
Buttoncanvas
1, Staticcanvas, the sort order I set to 0, I used to deal with some not used for touch screen and button (here is the mobile phone) the corresponding UI placement, such as the role of blood, magic value, bleeding hudtxt, the enemy's head of blood tips, etc.
2, Touchormousecanvas, the sort order I set to 1, is for the touch-screen response message set alone, such as through the touch screen to change the camera rotation, in the Touchormousecanvas directory to add a panel, Add an event Triger component, set its enent type to drag, and give it a specific message response function skill to achieve the touch screen control camera rotation.
3, Buttoncanvas, the sort order I set to 2, is used to handle a variety of button message response, the various buttons of the UI are placed in this
Attention:
These canvas render mode must be the same, and their sort order will work. As shown in the following figure
Second, Ugui components in addition to canvas is not inspector level set concept, the same root directory of components, is the root of the hierarchy relationship between the decision, who in the next, in the game and scene view, who will block who live.
Iii. Additional considerations when setting up a camera to individually render the layer layer of the UI
The following figure camera settings
Then canvas's render mode is set to screen Space-camera
Drag your own set of cameras to render camera
and canvas layer of layer to set up with their own camera culling mask the same, otherwise game vision will not see
Plane distance to be greater than 1 (0 to 1 is OK, but you have to adjust yourself to see in Game view), otherwise game view does not see
The culling mask of the UI camera above is the Uilayer layer
The following is a corresponding canvas screenshot