Using the Network Manager
The Network Manager HUD in LAN mode

Using the Network Manager HUD

Note: UNet is deprecated, and will be removed from Unity in the future. A new system is under development. For more information and next steps see this blog post and the FAQ.

Note: This documentation assumes that you understand fundamental networkingThe Unity system that enables multiplayer gaming across a computer network. More info
See in Glossary
concepts such as the relationship between a host, server and client. To learn more about these concepts, see documentation on Network System Concepts.

The Network Manager HUD component, as viewed in the inspector
The Network Manager HUD component, as viewed in the inspector
Property: Function:
Show Runtime GUI Tick this checkbox to show the Network ManagerA Networking component that manages the network state of a Project. More info
See in Glossary
HUD GUI at run time. This allows you to reveal or hide it for quick debugging.
GUI Horizontal Offset Set the horizontal pixelThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
See in Glossary
offset of the HUD, measured from the left edge of the screen.
GUI Vertical Offset Set the vertical pixel offset of the HUD, measured from the top edge of the screen.

The Network Manager HUD (“heads-up display”) provides the basic functions so that people playing your game can start hosting a networked game, or find and join an existing networked game. Unity displays the Network Manager HUD as a collection of simple UI(User Interface) Allows a user to interact with your application. More info
See in Glossary
buttons in the Game view.

The Network Manager HUD UI, as viewed in the Game view
The Network Manager HUD UI, as viewed in the Game view

The Network Manager HUD is a quick-start tool to help you start building your multiplayer game straight away, without first having to build a user interface for game creation/connection/joining. It allows you to jump straight into your gameplay programming, and means you can build your own version of these controls later in your development schedule.

It is not, however, intended to be included in finished games. The idea is that these controls are useful to get you started, but you should create your own UI later on, to allow your players to find and join games in a way that suits your game. For example, you might want to stylize the design of the screens, buttons and list of available games to match the overall style of your game.

To start using the Network Manager HUD, create an empty GameObject in your Scene (menu: GameObject > Create Empty) and add the Network Manager HUD component to the new GameObject.

For a description of the properties shown in the inspectorA Unity window that displays information about the currently selected GameObject, Asset or Project Settings, alowing you to inspect and edit the values. More info
See in Glossary
for the Network Manager HUD, see the Network Manager HUD reference page.

Using the HUD

The Network Manager HUD has two basic modes: LAN (Local Area Network) mode and Matchmaker mode. These modes match the two common types of multiplayer games. LAN mode is for creating or joining games hosted on a local area network (that is, multiple computers connected to the same network), and Matchmaker mode is for creating, finding and joining games across the internet (multiple computers connected to separate networks).

The Network Manager HUD starts in LAN mode, and displays buttons relating to hosting and joining a LAN-based multiplayer game. To switch the HUD to Matchmaker mode, click the Enable Match Maker (M) button.

Note: Remember that the Network Manager HUD feature is a temporary aid to development. It allows you to get your multiplayer game running quickly, but you should replace it with your own UI controls when you are ready.

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答