Important: UNet is a deprecated solution, and a new Multiplayer and Networking Solution (Netcode for GameObjects) is under development. For more information and next steps see the information on the Unity Netcode for GameObjects website. |
网络功能有两种用户:
Unity 的网络功能有一个“高级”脚本 API(我们称之为 HLAPI)。使用此 API 意味着可以访问满足多用户游戏大多数常见要求的命令,而无需担心“较低级别”的实现细节。HLAPI 提供以下功能:
Unity 的联网系统集成在引擎和 Editor 中,因此便于使用组件和视觉辅助工具来构建多人游戏。该系统具有以下功能:
Unity offers Internet Services to support your game throughout production and release, which includes:
We include a Real-Time Transport Layer that offers:
Unity 的网络系统实现了简单的内置身份验证功能,这些功能为验证会话提供了基本支持,但并不是可靠的身份验证解决方案。
可靠的身份验证可能是开发多人游戏项目的重要因素,因为它有助于防止恶意用户劫持玩家会话、冒充其他用户、使合法玩家与游戏断开连接或其他针对游戏或应用程序的恶意行为。
Because Unity only provides simple built-in authentication, if you require robust protection against malicious actions in your game or app, you should use 3rd party authentication and encryption solutions, or implement them yourself using plugins such as this reference implementation and the NetworkTransport API.
还可以深入了解我们的多人游戏示例项目,了解这些功能如何配合使用。可在此 Unity 论坛帖子中找到以下示例项目: