
using UnityEngine.UI
/// <summary>
/// 脚本功能:动态的添加按钮的点击事件
/// </summary>
public class Liste
var customSkin:GUISkinfunction OnGUI () {
if(GUI.Button(Rect(Screen.width/2-50, Screen.height/2+200, 100,50), "Play game"))
{
print("You clicked me")
Application.LoadLevel(1)
}
//GUI.Button(Rect(Screen.width/2-50, Screen.height/2+260, 100,50), "exit game")
if(GUI.Button(Rect(Screen.width/2-50, Screen.height/2+260, 100,50), "exit game"))
{
print("You clicked me")
Application.LoadLevel(2)
}
}
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)