Unity version: 4.5.1 ngui version: 3.5
Reference: http://blog.csdn.net/g__dragon/article/details/17242969,CSDN g_dragon
For more information about tabview, see the example in ngui, scenario examples \ scenes \ example 13-tabs.
1. Create a 2D UI using ngui, create a panel under the UI root, create two toggle under the panel, and create a tab key under the ngui as follows:
Open the new toggle In the widget wizard (legacy) panel:
2. Create two panels under the Panel to correspond to two toggle keys:
4. Associate the toggle key with the Panel, and add the script uitoggledobjects. CS for each toggle key:
5. Set the attributes of the two toggle keys:
Ui toggle (SCRIPT ):
Set Group to 1 (Same) in two toggle UI toggle (SCRIPT ),
Start state: Set whether to display the label at the beginning. Check the first label to be displayed, but not the rest;
Ui toggle objects (SCRIPT ):
In activate under UI toggle objects (SCRIPT) script, set the size value to 1 and drag the corresponding panel to the element. In this way, the toggle key displays Panel1, for example:
6. Now you can view the running effect:
When you click toggle 1, panel 1 is displayed. When you click toggle 2, panel 2 is displayed, and Panel 1 is initially displayed.
Summary:
Each tab in the reference link corresponds to a content, but content cannot be found in ngui, instead of panel. Logically speaking, it should also be a window;
Code: https://github.com/vitah-lin/Unity
Unity ngui tabview