public void Login() { account = accountIF.text; password = passwordIF.text; string sendMsg = "{" + "\"account\":\"" + account + "\"," + "\"password\":\"" + password + "\"}"; clientConnect.SocketSender(sendMsg); canReceiveLogin = true; //StartCoroutine(WaitCloseLogin(1)); }
void GameOver() { //set game state isPlaying = false; // Time.timeScale = 0; //save score scoreNum = PlayerManager.instance.player.GetComponent <PlayerStates>().scoreNum; dateTime = System.DateTime.Now.ToString(); string value = "{\"account\":\"" + ClientLogin.account + "\",\"password\":\"" + ClientLogin.password + "\",\"score\":\"" + scoreNum + "\",\"time\":\"" + dateTime + "\"}"; //connect to server clientConnect.InitClientConnect(); clientConnect.SocketSender(value); StartCoroutine(ClientCloseConnect(1)); //show and disappear UI and cursor Cursor.visible = true; health.SetActive(false); score.SetActive(false); countdownUI.SetActive(false); gameOverBoardManager.ShowBoard(scoreNum); gameOverBoardAnimator.SetBool("ShowGameOverBoard", true); }