The difference between C # and JS for unity development:
C # defined function must declare function type (void, etc.), but JS can be unknown function type directly defined (function)
Note that the C # script has a new JS script in front of rect.
Example: Creating a GUI control in unity
Using scripts in unity requires the binding of game objects. For example, the GUI needs to be bound in the camera object to be displayed in the game interface. To do this, select the game object (for example, camera), click "Add Component" in the right inspector and select the script that needs to be bound.
C # Script:
void Ongui ()
{
The Background box
Gui. Box (new Rect (10,10,100,90), "Load menu");
}
JS script:
Function Ongui ()
{
The Background box
Gui. Box (Rect (10,10,100,90), "Load menu");
}
This article is from the "7ntxx-13" blog, make sure to keep this source http://chiliming.blog.51cto.com/4285688/1856802
Unity Development Experience (1)