public void OnNewGameButtonClicked() { socketIO.StartNewGame(response => { var jsonResponse = JSONObject.Parse(response); GameIDTextElement.text = "Game ID: <b>" + jsonResponse["gameID"] + "</b>"; socketIO.ChangeGameState("build"); }); }
public void OnStartButtonClicked() { // TODO: need to make sure we're connected to the socket before we can do this SocketIO.StartNewGame(responseString => { var responseJSON = JSON.Parse(responseString); FindObjectOfType <JoinGameUI>().ShowGameID(responseJSON["gameID"]); GameStateManager.Instance.ChangeState(GameStateManager.GameStates.LOBBY); Destroy(gameObject); }); }