예제 #1
0
    public void OnNewGameButtonClicked()
    {
        socketIO.StartNewGame(response =>
        {
            var jsonResponse       = JSONObject.Parse(response);
            GameIDTextElement.text = "Game ID: <b>" + jsonResponse["gameID"] + "</b>";

            socketIO.ChangeGameState("build");
        });
    }
예제 #2
0
    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);
        });
    }