Beispiel #1
0
    void OnCreateRoom()
    {
        if (LobbyManager.currentRoom == null)
        {
            UIController.ThrowError("V_CustomLobbyManager: currentRoom is not set", UIController.CloseError);
            // do something about it!!! and then:
            return;
        }
        if (roomName.text == "")
        {
            UIController.ThrowError("The name of the room cannot be empty.", UIController.CloseError);
            return;
        }
        LobbyManager.currentRoom.roomName = roomName.text;

        LobbyManager.currentRoom.map = UIController.ReturnMap(mapName.text);

        LobbyManager.currentRoom.playerMode = UIController.ReturnPlayerMode(playerMode.options[playerMode.value].text);

        LobbyManager.currentRoom.gameMode = UIController.ReturnGameMode(gameMode.options[gameMode.value].text);

        LobbyManager.currentRoom.password = password.text;

        LobbyManager.SaveRoom(LobbyManager.currentRoom.ID, LobbyManager.currentRoom);

        UIController.Disable_EnableUI(this.gameObject);
        UIController.GoFrom_To(UIController.currentPanel, UIController.RoomPanel);
    }
Beispiel #2
0
    void ChangeGameMode(GameModes mode)
    {
        V_RoomTemplate tmpRoom = new V_RoomTemplate();

        tmpRoom.gameMode = mode;

        if (firstCreateTheRoom)
        {
            // register the room on the server
            // and then on the lobby manager
            LobbyManager.isMasterServer = true;
            LobbyManager.SaveRoom(tmpRoom);
            UIController.Enable_DisableUI(UIController.RoomModalPanel);
        }
        else
        {
            // filter the Available Rooms base on the selected gameMode
            LobbyManager.isMasterServer = false;
            LobbyManager.QuickStartRoom(mode);
            UIController.GoFrom_To(UIController.LobbyPanel, UIController.RoomPanel);
        }
    }