Пример #1
0
    /*
     *   After "Join" button in "JoinGameScene"
     *   Setup server address and port, start client
     */
    public void SetupClient()
    {
        Debug.Log("SetupClient");

        try
        {
            // persists config data from menu scene
            gameApp.PersistAllParameters("JoinGameScene");

            this.networkAddress = gameApp.GetAndRemoveInputField("ServerAddress");
            this.networkPort    = int.Parse(gameApp.GetAndRemoveInputField("ServerPort"));

            // uncomment for testing
            //this.networkAddress = "127.0.0.1";
            //this.networkPort = 7777;
            this.StartClient();
        } catch (Exception e)
        {
            Debug.Log("SetupClient error: " + e.Message);
            errorInfoPanel.Show("SetupClient error: " + e.Message);
            return;
        }
    }