Sun Guangdong 2015.7.12
There are two kinds of network functions for users:
? Users use Unity to create multiplayer games. These users should start using the NetworkManager or the high level API.
? Users to build network infrastructure or advanced multiplayer games. These users should start using the Networktransport API.
High-level scripting API Advanced Scripting API
Unity's network has a "high-level" scripting API (which we'll call Hlapi). Use this method to access commands that cover the most common requirements of user games without worrying about "lower level" execution details. Hlapi, you can:
? Use "Network Manager" to control the online status of the game.
? The host is a player client. Operation "Network Manager". Games
? The data is serialized using a common serializer.
? Send and receive messages messages.
? Sends commands for the network from the client to the server.
? Remote Procedure Call (RPC) from the server to the client.
? Sends the network's events from the server to the client.
Engine and Editor Integration
Unity's network integrates into the engine and editor, allowing you to use components and visual aids to build your multiplayer game. It provides:
? The networkidentity component of the network object.
? Networkbehaviour the network script.
? You can configure transformations for automatic synchronization objects.
? Automatic synchronization of script variables.
? The objects that support the network are placed in Unity's scene.
? Network components
Internet Services
Unity provides Internet services to support your game throughout the production and distribution, including:
? Matchmaking Service
? Create matches and advertise matches.
? List available matches and join matches.
? Relay Server
? Game-play over the Internet with no dedicated server.
? Routing of messages for participants of matches.
Networktransport Real-time Transport layer
Unity includes providing a live transport layer:
? Optimized based on UDP protocol.
? Multi-channel design to avoid head-of-line blocking issues multichannel designs to avoid head line blocking issues
? Each channel supports a variety of levels quality of service (QoS).
? A flexible network topology that supports peer or client-server architectures.
High Level API
The high-level API (HLAPI) is a system unity game that builds multiplayer features. It builds on a lower level of transmission real-time communication layer, and handles many common tasks for multiplayer games. While the transport layer supports any form of network topology, HLAPI is the authoritative system of a server; Although it allows at the same time to be one of the client and server participants, there is no dedicated server process. This work combines an Internet service that allows a multiplayer game to be played on the Internet with small jobs from developers.
HLAPI is unity a new set of network command integrations in the new namespaces; Unityengine.networking It focuses on ease-of-use and iterative development, such as providing useful services for multiplayer games:
? Message handlers
? Universal High Performance serialization
? Distributed Object Management
? State synchronization
? Network Classes:server, Client, Connection, etc
Hlapi is a series of layers that add functionality:
??
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Unity5.1 new network engine unet (i) Summary 2