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");
}
}
本文深入探讨了Unity中OnGUI()函数的使用,解释了其与Update()函数的区别,并提供了实例演示如何在游戏开发中利用OnGUI()绘制用户界面元素。
2670

被折叠的 条评论
为什么被折叠?



