- 最后登录
- 2018-6-29
- 注册时间
- 2011-7-1
- 阅读权限
- 20
- 积分
- 359
- 纳金币
- 335582
- 精华
- 0
|
using UnityEngine;
using System.Collections;
public class twst1 : MonoBehaviour
{
public GUISkin myskin;
public static string username = "";
public static string pwd = "";
public static bool flag=false;
public static bool guiflag = true;
void OnGUI()
{
GUI.skin = myskin;
if (guiflag)
{
GUI.BeginGroup(new Rect((Screen.width - 300) / 2, (Screen.height - 200) / 2, 300, 200));
GUI.Box(new Rect(0, 0, 300, 200), "");
GUI.Label(new Rect(10, 5, 70, 40), "登录窗体");
GUI.Label(new Rect(40, 50, 65, 25), "用户名:");
username = GUI.TextField(new Rect(105, 50, 120, 25), username);
GUI.Label(new Rect(40, 90, 65, 25), "密 码:");
pwd = GUI.PasswordField(new Rect(105, 90, 120, 25), pwd, "*"[0]);
if (GUI.Button(new Rect(70, 140, 50, 25), "登录"))
{
flag = true;
}
if (GUI.Button(new Rect(160, 140, 50, 25), "重置"))
{
username = GUI.TextField(new Rect(105, 50, 100, 25), "");
pwd = GUI.TextField(new Rect(105, 90, 100, 25), "");
}
GUI.EndGroup();
}
}
}
|
|