Ejemplo n.º 1
0
    public void JoinLobby()
    {
        string ipAddress = m_ipInputField.text;

        m_networkManager.networkAddress = ipAddress;
        m_networkManager.StartClient();

        m_joinButton.interactable = false;
    }
    private void OnLobbyEntered(LobbyEnter_t callback)
    {
        if (NetworkServer.active)
        {
            return;
        }

        string hostAdress = SteamMatchmaking.GetLobbyData(
            new CSteamID(callback.m_ulSteamIDLobby),
            HostAdressKey);

        networkManager.networkAddress = hostAdress;

        networkManager.StartClient();
        menuManager.NavigateToMenu("Lobby");
    }
Ejemplo n.º 3
0
    public void JoinLobby()
    {
        displayName = displayNameInputField.text;

        if (DisplayNameAccepted(displayName))
        {
            SaveName(displayName);

            joinLobbyButton.interactable  = false;
            networkManager.networkAddress = ipAdressInputField.text;

            networkManager.StartClient();


            SetErrorMessage("Connecting...", Color.yellow);
        }
        else
        {
            SetErrorMessage(("'" + displayName + "'" + " is not a valid name!"), Color.red);
        }
    }