Unity Mirror - Ids
Unity Mirror - Ids
Asset Id
Mirror uses GUIDs as Asset Ids for asset identifiers. Every prefab with a NetworkIdentity component has an Asset Id. This is simply Unity's AssetDatabase.AssetPathToGUID converted to 16 bytes. Mirror needs this information to know which prefabs will be spawned.
Scene Id
Mirror uses uint for scene identifiers. Every game object in the scene (in the hierarchy) with a NetworkIdentity is assigned a scene id within OnPostProcessScene. Since Unity does not have a unique identifier for different game objects in the scene, Mirror needs this information to distinguish objects from each other.
Network Instance Id
Mirror uses uint as NetId. Each NetworkIdentity is assigned a NetId after NetworkIdentity.OnStartServer or after being spawned. Mirror uses this identifier to specify to which object messages should be sent in communication between the client and server.
Connection Id
Each network connection has a connection identifier, which is assigned by the low-level Transport layer. Connection id 0 is reserved for the local connection where the server is also the client.


Yorum Gönder