private bool _gender = false;
private string _admin = string.Empty;
private string _psw = string.Empty;
void Start()
{
}
void Update()
{
}
private void OnGUI()
{
//简单用户登录
GUI.Label(new Rect(20, 60, 50, 50), "用户名:");
_admin = GUI.TextField(new Rect(80, 60, 120, 30), _admin);//单行文本框
GUI.Label(new Rect(20, 140, 50, 50), "密码:");
_psw = GUI.PasswordField(new Rect(60, 140, 120, 30), _psw,'#');//密码框
_gender =GUI.Toggle(new Rect(20, 180, 100, 20), _gender,"男");//开关
_gender = GUI.Toggle(new Rect(20, 210, 100, 20), !_gender, "女");
GUI.Button(new Rect(80, 250, 40, 40), "登录");//按钮
}