Exemplo n.º 1
0
    /// <summary>
    /// Populates game settings for broadcast to clients and attempts to start matchmaking server session.
    /// </summary>
    private void StartMatchmakingGame()
    {
        //GameSettings settings = GameSettings.s_Instance;
        //settings.SetMapIndex(m_MapSelect.currentIndex);
        //settings.SetModeIndex(m_ModeSelect.currentIndex);

        menuUi.ShowConnectingModal(false);

        netManager.StartMatchmakingGame(GetGameName(), (success, matchInfo) =>
        {
            if (!success)
            {
                menuUi.ShowInfoPopup("Failed to create game.", null);
            }
            else
            {
                menuUi.HideInfoPopup();
                menuUi.ShowLobbyPanel();
            }
        });
    }