UnityGUI
在控制脚本激活的状态下,OnGUI()函数每帧都调用,跟Update( )函数一样
such as
function OnGUI () {
GUI.Label(Rect(50, 100,200,20),"This is Label 1 ");
GUI.Label(Rect(50, 120,200,20),"This is Label 2 ");
GUI.Label(Rect(50, 140,200,20),"This is Label 3 ");
if (GUI.Button (Rect (10,70, 100, 20), "This is text")) {
print ("you clicked the text button");
}
}