private void Room() { if (_matching) { LxcTools.EnableTextButton(matchButton); LxcTools.EnableTextButton(quitButton); LxcTools.EnableTextButton(logoutButton); numberText.enabled = true; hintText.text = "取消了匹配"; } else { if (numberText.text.Equals("")) { hintText.text = "房间号为空"; return; } LxcTools.DisableTextButton(matchButton, 0.3f, false); LxcTools.DisableTextButton(logoutButton, 0.3f, false); LxcTools.DisableTextButton(quitButton, 0.3f, false); numberText.enabled = false; hintText.text = "等待玩家加入 " + numberText.text; } _matching = !_matching; Client.Room(numberText.text); }
private void Surrender() { surrenderButton.enabled = false; Client.Surrender(); LxcTools.EnableTextButton(backButton); LxcTools.DisableTextButton(surrenderButton, 0.3f, false); }
private void Match() { if (_matching) { LxcTools.EnableTextButton(roomButton); LxcTools.EnableTextButton(quitButton); LxcTools.EnableTextButton(logoutButton); hintText.text = "取消了匹配"; } else { LxcTools.DisableTextButton(roomButton, 0.3f, false); LxcTools.DisableTextButton(logoutButton, 0.3f, false); LxcTools.DisableTextButton(quitButton, 0.3f, false); hintText.text = "开始随机匹配"; } _matching = !_matching; Client.Match(); }
private void SetMode(int mode) { _mode = mode; switch (_mode) { case 1: _submitText.text = "登录"; usernameField.text = ""; passwordField.text = ""; usernameField.enabled = true; passwordField.enabled = true; LxcTools.DisableTextButton(registerButton, 0.3f, true); LxcTools.DisableTextButton(guestButton, 0.3f, true); LxcTools.EnableTextButton(loginButton); break; case 2: _submitText.text = "注册并登录"; usernameField.text = ""; passwordField.text = ""; usernameField.enabled = true; passwordField.enabled = true; LxcTools.DisableTextButton(loginButton, 0.3f, true); LxcTools.DisableTextButton(guestButton, 0.3f, true); LxcTools.EnableTextButton(registerButton); break; case 3: _submitText.text = "游客身份登录"; usernameField.enabled = false; passwordField.enabled = false; LxcTools.DisableTextButton(loginButton, 0.3f, true); LxcTools.DisableTextButton(registerButton, 0.3f, true); LxcTools.EnableTextButton(guestButton); break; } hintText.text = null; }
private void Start() { backButton.onClick.AddListener(Back); surrenderButton.onClick.AddListener(Surrender); LxcTools.DisableTextButton(backButton, 0, false); }