http://blog.csdn.net/xtxy/article/details/37876825
In the use of unity2d development game, the use of Ngui as the interface, the two are very good, but a use of the scene there is a problem, is a Ngui sprite needs to be placed behind the unity2d sprite display, That is, with the Ngui sprite as the background, the results found to replace the altas of the sprite, the background of the unity2d sprite obscured, using the z-axis cannot control.
After searching the internet, we found a solution that Ngui adapted to the Unity 2d layer, recorded here.
1 Create a new sorting layer, add a foreground, and background, move the background to the top as shown:
2 Create two Pannel under UI Root, a normal UI element, and a background element;
The background element of the pannel above changes the option to render Q, set it to explicit, the layer number is 3000, corresponding to the above background;
The UI element of the pannel above changes the option to render Q, set it to start at, the layer number is 3002, corresponding to the above foreground;
All of the Unity 2d sprite sorting layers remain default, which ensures that the UI is on top, Unity 2d sprite is in the middle, and the background is on the bottom.
Unity 2d and NGUI layer