From bb8412d5e773d81202ef03458dfdc89848a06e45 Mon Sep 17 00:00:00 2001 From: vis2k Date: Thu, 26 May 2022 23:32:08 +0700 Subject: [PATCH] NetworkIdentity Serialization: explain write index --- Assets/Mirror/Runtime/NetworkIdentity.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Mirror/Runtime/NetworkIdentity.cs b/Assets/Mirror/Runtime/NetworkIdentity.cs index 66d7ffdf5..0e37b2b20 100644 --- a/Assets/Mirror/Runtime/NetworkIdentity.cs +++ b/Assets/Mirror/Runtime/NetworkIdentity.cs @@ -930,7 +930,9 @@ internal void OnSerializeAllSafely(bool initialState, NetworkWriter ownerWriter, // observers writer too int startPosition = ownerWriter.Position; - // write index as byte [0..255] + // write index as byte [0..255]. + // necessary because deserialize may only get data for some + // components because not dirty, not owner, etc. ownerWriter.WriteByte((byte)i); // serialize into ownerWriter first