メインコンテンツまでスキップ

マッチメイキング後の UI - 専用サーバーでのクイックマッチ - (Unity モジュール)

Last updated on November 25, 2024

Match Lobby UI

The match lobby user interface (UI) is a predefined UI that was created using a canvas and a panel. This UI will be displayed when the players have successfully connected to the game server. It displays the information about the teams and their members, such as usernames and avatars. You can find this UI located in /Assets/Resources/Modules/MainMenu/MatchLobby/MatchLobbyMenuCanvas.prefab.

Match lobby prefab in Unity Byte Wars with DS matchmaking

注記

The functionality to display player usernames and avatars has been provided for you so you can focus on implementing matchmaking.

The match lobby UI has two main buttons: the StartButton to travel the players to the gameplay level, and the QuitButton to quit the game. You can find the declarations for these buttons in /Assets/Scripts/UI/MainMenu/MatchLobbyMenu.cs.

private void Start()
{
startButton.onClick.AddListener(StartGame);
quitButton.onClick.AddListener(LeaveSessionAndQuit);
}

To display the teams and their members, the match lobby UI uses the following sub-UIs:

Team Entry UI

The match lobby UI will show one or multiple teams depending on the game mode. To distinguish the team members, it uses the team entry UI to group the players.

Team entry prefab in Unity Byte Wars with DS matchmaking

Player Entry UI

To display team member information (such as usernames and avatars), this UI is used.

Payer entry prefab in Unity Byte Wars with DS matchmaking

Pause Menu UI

When your players enter the gameplay level, they will be able to open the pause menu. You can find this UI located in /Assets/Resources/Modules/MainMenu/GamePlay/PauseMenuCanvas.prefab.

Game pause menu prefab in Unity Byte Wars with DS matchmaking

The pause menu UI has three main buttons: ResumeBtn to close the pause menu, RestartBtn to restart the game (which will only be displayed in local multiplayer), and QuitBtn to quit the game. You can find the declarations for these buttons in /Assets/Scripts/UI/Gameplay/PauseMenuCanvas.cs.

void Start()
{
resumeBtn.onClick.AddListener(OnResumeBtnClicked);
restartBtn.onClick.AddListener(OnRestartBtnClicked);
quitBtn.onClick.AddListener(OnQuitBtnClicked);
}

Game Over UI

When the game is over, this UI will be displayed. You can find this UI located in /Assets/Resources/Modules/MainMenu/GamePlay/GameOverMenuCanvas.prefab.

Game over menu prefab in Unity Byte Wars with DS matchmaking

The game over UI has two main buttons: playAgainBtn to play the game again (which will only be displayed in local multiplayer), and quitBtn to quit the game. You can find the declarations for these buttons in the /Assets/Scripts/UI/Gameplay/GameOverMenuCanvas.cs.

private void Start()
{
playAgainBtn.onClick.AddListener(OnPlayAgainButtonClicked);
quitBtn.onClick.AddListener(OnQuitButtonClicked);
}

Resources