The Network Manager
网络管理器
In this lesson, we will create a new Network Manager. This Network Manager will control the state of this Multiplayer project, including game state management, spawn management, scene management, matchmaking and allowing access to debugging information. For advanced users, it is possible to derive a class from NetworkManager to customize the behaviour of the Component. Extending theNetworkManager is not covered in this lesson.
在本课中,我们将创建一个新的网络管理器。这个网络管理员将控制这个多人项目的状态,包括游戏状态管理、衍生管理、场景管理、配对和允许访问调试信息。对于高级用户,可以从NetworkManager派生类来定制组件的行为。扩展网络管理器在本课中没有涉及。
To create a new Network Manager, we will create a new GameObject and add the NetworkManager and NetworkManagerHUDComponents.
要创建一个新的网络管理器,我们将创建一个新的GameObject并添加NetworkManager和NetworkManagerHUD组件。
Create a new empty GameObject.
创建一个新的空的GameObject。
Rename the new GameObject “Network Manager”.
重新命名新的GameObject“网络管理器”。
With the Network Manager GameObject selected:
选择了Network Manager GameObject:
... find and add the component: Network > NetworkManager.
…查找并添加组件:Network > NetworkManager。
... find and add the component: Network > NetworkManagerHUD
…查找并添加组件:网络> NetworkManagerHUD。
The NetworkManager component manages the network state of the game.
The NetworkManagerHUD component works with the NetworkManager and provides a simple user interface to control the network state of the game when the game is running.
At run-time, the NetworkManagerHUD will look like this: