One: Panel panels
1. Layering, there can be multiple empty pieces per layer in the Ngui
2. Create a panel:
Ngui->open->ui wizard-> Select layers in the Layer option, select the camera in the cameras option to create a successful
3. Add a script to the panel:
Create a new empty object under the Panel and add a panel script component to the empty object
You can then add the controls under this panel.
Two: Label text field
1. Adding a Label control to a panel
2. Adjust the corresponding properties in the Properties panel
Three: Message mechanism
1. Attach the script directly to the button, such as button, to implement OnClick () in the script to respond to the Click event
2. Using Sendmassage, add button massage components for the buttons, set target,function name,trigger,include children to respond to Trigger events, Then call the function method of the target object.
3. Using Uilistener, add the event listener component for the button. Then you can get the click event of the button in any script and get the method as follows:
Void Awake ()
{
Gameobject button = Gameobject.find ("this button");
Uieventlistener.get (Button). OnClick = The name of the method you want to invoke, if said to be a;
}
Void A (gameobject button)
{
.........
}
NGUI Study Notes 1