コード例 #1
0
    public void HostLobby()
    {
        displayName = displayNameInputField.text;
        if (DisplayNameAccepted(displayName))
        {
            SaveName(displayName);

            Debug.Log($"Hosting a lobby on IP: {networkManager.networkAddress}");

            menuManager.NavigateToMenu("Lobby");
            networkManager.StartHost();

            ipAdressNotification.enabled = true;
            ipAdressNotification.text    = "IP - Adress: " + networkManager.networkAddress;
        }
    }
コード例 #2
0
    public void SubmitForm()
    {
        playerListPanel.SetActive(true);
        playerInputPanel.GetComponent <PlayerInputController>().SetPlayerName(hostName.text);
        networkManager.maxConnections = numPlayersDropdown.value + 2;

        if (hostAndJoinToggle.isOn)
        {
            networkManager.StartHost();
        }
        else
        {
            networkManager.StartServer();
        }

        gameObject.SetActive(false);
    }
コード例 #3
0
    private void OnLobbyCreated(LobbyCreated_t callback)
    {
        if (callback.m_eResult != EResult.k_EResultOK)
        {
            return;
        }

        LobbyID = new CSteamID(callback.m_ulSteamIDLobby);

        networkManager.StartHost();
        menuManager.NavigateToMenu("Lobby");
        menuManager.HideLoading();

        SteamMatchmaking.SetLobbyData(
            LobbyID,
            HostAdressKey,
            SteamUser.GetSteamID().ToString());
    }
コード例 #4
0
 public void OnPlayAndHostPressed()
 {
     lobbyNetworkManager.StartHost();
 }
コード例 #5
0
 public void HostLobby()
 {
     networkManager.StartHost();
     landingPagePanel.SetActive(false);
 }