您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
nathaniel.buck@unity3d.com 91255d28 Readme edits. 3 年前
Assets Merge pull request #9 from Unity-Technologies/master-lobby_merge_resolution-beta_packages_included-public_release_staging 3 年前
Packages Merge pull request #9 from Unity-Technologies/master-lobby_merge_resolution-beta_packages_included-public_release_staging 3 年前
ProjectSettings Merge pull request #9 from Unity-Technologies/master-lobby_merge_resolution-beta_packages_included-public_release_staging 3 年前
~Documentation/Images Merge pull request #7 from Unity-Technologies/dev 3 年前
.gitignore Updated latest Lobby Rename and Moved Relay allocation to Countdown. 3 年前
README.md Readme edits. 3 年前

README.md

Closed Beta - 7/14/21

Lobby and Relay are only available in closed beta at the moment. To use these services, you will need to have signed up here for the services to show in your organization: https://create.unity3d.com/relay-lobby-beta-signup

Game Lobby Sample

Unity 2021.2 0b1

This is a Unity project sample showing how to integrate Lobby and Relay into a typical game lobby experience.

Features Covered:
- Lobby Creation
- Lobby Query
- Lobby Data Sync
  - Emotes
  - Player Names
  - Player Ready Check State  
- Lobby Join
- Relay Server Creation
- Relay Code Generation
- Relay Server Join

Service Organization Setup

Create an organization

Follow the guide to set up your cloud organization:

Organization Tutorial

Then, in the Unity Editor, open Services > General Settings to create a cloud project ID (or link to an existing one) to associate the Unity project with your organization.

Lobby & Relay

We use the Lobby service to create a space that our users can join and share data through.

Lobby Overview

Lobby Dashboard

We use the Relay service to obfuscate the hosts' IP, while still allowing them to locally host strangers.

Relay Overview

Relay Dashboard

Setup

For either one, select "About & Support => Get Started."

Closed Beta Only

Follow the steps, downloading your packaged folders to the Sample Project Package\Packages

*If you open the project and you get the "Enter Safe Mode" dialogue, it means you are missing your packages.*

*If you still cannot find the package namespaces, ensure the Assets/Scripts/LobbyRelaySample.asmdef is referencing the packages.*

Follow the steps until you reach "Lobby/Relay On."

Solo Testing

Create a build of the project in the OS of your choice. The Authentication service creates a unique ID for builds, so you may run a build and the Editor at the same time to represent two users.

  1. Enter Play mode, and select Start to open the lobby list. This queries the Lobby service for available lobbies, but there are currently none.

Join Menu

  1. The Create menu lets you host a new lobby.

Create Menu

  1. This is the lobby. It has a shareable lobby code to allow other users to join directly. For demonstration purposes, we also show the Relay code, which will be passed to all users in the lobby.

Lobby View

  1. Run your build, and as this second user, you should now see your lobby in the list.

Populated Join View

  1. The lobby holds up to 4 users and will pass the Relay code once all the users are ready. Changes to a user's name or emote will appear for other users after a couple seconds.

Relay Ready!

  1. Once the lobby host has received a ready signal from all users, it will send out a countdown, and all users will enter a simultaneous countdown before connecting to Relay.

Countdown!

  1. An anonymous IP from the Relay service is passed to all users in the lobby, at which point your game logic could connect them to a server and begin transmitting realtime data.

InGame!