To Add a font:
Drag the downloaded font to the Project panel-click the dot after the Text property in the text component-Select the font you just dragged.
Create togglegroup (switch group):
1. Create two toggle under a canvas
2. Create an empty object under the canvas (named Togglegroup) and add a Togglegroup component to the Togglegroup
3. Select the two toggle, drag the Togglegroup to the toggle component's group position, that is, complete the selection between two options (the Togglegroup component of allow Switch off can be allowed to do not select, But does not support multiple selection)
There are two ways to add controls to listen on events (for example, button):
Method One: This method has less code to write, but has more operations in unity
1. Create an empty object (named Uguictrl) in the Hieraychy panel and Add the button control.
2. Create a C # script named Uguiscr and hang the script on the Uguictrl.
2. Open script Write a public method-print 123
Public void Print123 () {Print ("123"); }
After running, when you click the button, the console panel will print 123.
Method Two: This method code writes more, but the operation in unity is relatively small.
1. Create an empty object (named Uguictrl) in the Hieraychy panel and Add the button control.
2. Create a C # script named Uguiscr and hang the script on the Uguictrl.
2. Open the script to write a public method-print 123.
Public classuguictrl:monobehaviour{//Get button Component PublicButton Buttonctrl; voidStart () {//method written in Strat.ButtonCtrl.onClick.AddListener (Print123); } //This method can be written in the form of a lambda expression Public voidPrint123 () {print ("123"); }}
After running, when you click the button, the console panel will print 123.
Primary applications of Unity3d-ugui