/// <summary> /// 注册界面 /// </summary> private void OnDrawRegister(GUIStyle fontStyle) { const int gx = 30; var curY = 10; GUILayout.BeginHorizontal(); //--------------------------------------------------------------------------- GUI.Label(new Rect(gx, curY, 40, 20), "用户名", fontStyle); _regName = GUI.TextField(new Rect(gx + 55, curY, 100, 20), _regName); GUILayout.EndHorizontal(); curY += 25; GUILayout.BeginHorizontal(); //--------------------------------------------------------------------------- GUI.Label(new Rect(gx, 35, 40, 20), "密 码", fontStyle); _regPwd = GUI.TextField(new Rect(gx + 55, curY, 100, 20), _regPwd); GUILayout.EndHorizontal(); curY += 25; GUILayout.BeginHorizontal(); //--------------------------------------------------------------------------- GUI.Label(new Rect(gx, curY, 40, 20), "昵 称", fontStyle); _regNike = GUI.TextField(new Rect(gx + 55, curY, 100, 20), _regNike); GUILayout.EndHorizontal(); curY += 60; GUILayout.BeginHorizontal(); //--------------------------------------------------------------------------- if (GUI.Button(new Rect(gx, curY, 40, 20), "注 册")) { // var needCreate = PlayerPrefs.GetInt("login_editor_needCreate") == 1; // if (needCreate) UserController.Instance.Restier(_regName, _regPwd, _regNike, "", 1, OnCreateUI); // else UserController.Instance.Restier(_regName, _regPwd, _regNike, "", 1, OnLocalLogin); } if (GUI.Button(new Rect(gx + 70, curY, 40, 20), "取 消")) { _showUIType = 0; } GUILayout.EndHorizontal(); }
public void Start() { boot = new GameBootState(); checkUpdate = new GameCheckUpdateState(); login = new GameLoginState(); maincity = new GameMainCityState(); battle = new GameBattleState(); // 游戏启动的入口 this.CurState = boot; this.AnyState = new GameAnyState(); this.AddTransition(boot, checkUpdate, bootOverTrigger, null); // update app 属于强制更新,该状态没有出口 this.AddTransition(checkUpdate, login, updateResOverTrigger, null); this.AddTransition(login, maincity, loginSuccessTrigger, null); //this.AddTransition(maincity, battle, , null); //this.AddTransition(battle, maincity, , null); // 切换账号,重新登录 this.AddTransition(this.AnyState, login, reLoginTrigger, null); }
protected void OnCreateUI(object msg) { _showUIType = GameLoginState.Create; }