Exemplo n.º 1
0
    public static void MultiplayerLeaveLobby()
    {
        ConfirmMenu menu = MenuSystem.instance.GetMenu <ConfirmMenu>();

        if (NetGame.isServer)
        {
            if (NetGame.instance.allclients.Count <= 0)
            {
                App.instance.StopServer();
                return;
            }
            menu.SetUp("MULTIPLAYER/CONFIRM.StopLobby", "MULTIPLAYER/CONFIRM.WillDestroyLobby", "MULTIPLAYER/CONFIRM.STOPLOBBY", "MULTIPLAYER/CONFIRM.CANCEL", delegate
            {
                App.instance.StopServer();
            }, delegate
            {
                menu.TransitionBack <MultiplayerLobbyMenu>();
            });
        }
        else
        {
            menu.SetUp("MULTIPLAYER/CONFIRM.LeaveLobby", "MULTIPLAYER/CONFIRM.Leaving", "MULTIPLAYER/CONFIRM.LEAVE", "MULTIPLAYER/CONFIRM.CANCEL", delegate
            {
                App.instance.LeaveLobby();
            }, delegate
            {
                menu.TransitionBack <MultiplayerLobbyMenu>();
            });
        }
        MenuSystem.instance.activeMenu.TransitionForward <ConfirmMenu>();
    }
Exemplo n.º 2
0
    public static void MultiplayerExitGame()
    {
        ConfirmMenu menu = MenuSystem.instance.GetMenu <ConfirmMenu>();

        if (NetGame.isServer)
        {
            menu.SetUp("MULTIPLAYER/CONFIRM.ExitToLobby", "MULTIPLAYER/CONFIRM.WillTransferToLobby", "MULTIPLAYER/CONFIRM.EXIT", "MULTIPLAYER/CONFIRM.CANCEL", delegate
            {
                App.instance.PauseLeave();
            }, delegate
            {
                menu.TransitionBack <MultiplayerPauseMenu>();
            });
        }
        else
        {
            menu.SetUp("MULTIPLAYER/CONFIRM.ExitMultiplayer", "MULTIPLAYER/CONFIRM.WillExitMultiplayer", "MULTIPLAYER/CONFIRM.EXIT", "MULTIPLAYER/CONFIRM.CANCEL", delegate
            {
                App.instance.PauseLeave();
            }, delegate
            {
                menu.TransitionBack <MultiplayerPauseMenu>();
            });
        }
        MenuSystem.instance.activeMenu.TransitionForward <ConfirmMenu>();
    }