登陆页面
using UnityEngine;
using System.Collections;
public class Login : MonoBehaviour {
private string editUserName;
private string editUserPwd;
private string editShow;
void Start()
{
editShow = "Please Input Your Login";
editUserName = "请输入用户名";
editUserPwd = "请输入密码";
}
void OnGUI()
{
GUI.Label (new Rect (10, 10, Screen.width, 30), editShow);
if( GUI.Button( new Rect( 10, 120 ,100, 50 ), "Login" ) )
{
editShow = " 用户名: " + editUserName + " 密码: " + editUserPwd;
}
GUI.Label (new Rect (10, 40, 50, 30), "用户名:");
GUI.Label ( new Rect( 10, 80 ,50 ,30), "密码:" );
editUserName = GUI.TextField (new Rect (60, 40, 200, 30), editUserName, 15);
editUserPwd = GUI.PasswordField (new Rect (60, 80, 200, 30), editUserPwd, "*"[0], 15);
}
}