Unity 2d and NGUI layer

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.