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 网络的工作方式。
NetworkConnection
,而 NetworkServer 具有多个连接:与每个客户端有一个连接。NetworkConnection 能够作为网络消息来发送字节数组或序列化对象。