3 Differences from UNET HLAPI
Albin Corén редактировал(а) эту страницу 2018-07-24 15:13:26 +02:00

This documentation is outdated.

Here are some notable differences between the UNET HLAPI and the MLAPI:

  • Messages do not have to be targeted. That is, a non-targeted message will be invoked on every registered handler.

  • MLAPI does not have an authority system, any client can send a targeted message targeted at any netBehaviour. This can easily be enforced by the developer as shown below

private void OnMyMessageRecieved(uint clientId, byte[] data)
{
    if(clientId != ownerClientId) //If the sender of the message is not the one who owns the object.
        return; //Return, this is sent without authority.
}
  • Static scene objects need to be spawnable prefabs
  • ~Each NetworkedBehaviour can have 255 SyncedVar's instead of 32~ versions > v1.1.1 has no limit
  • The MLAPI handles scene mangement differently, the HLAPI destroys and recreates networked objects after a full scene switch. The MLAPI loads the new scene additivley, then moves networkedObjects from the old scene to the new scene and lastly unloads the old scene, thus destroying the old objects.
  • If sceneManagement is enabled, every scene used has to be registered as a networkedScene.