NetworkIdentity Serialization: explain write index

This commit is contained in:
vis2k 2022-05-26 23:32:08 +07:00
parent adb66b427c
commit bb8412d5e7

View File

@ -930,7 +930,9 @@ internal void OnSerializeAllSafely(bool initialState, NetworkWriter ownerWriter,
// observers writer too // observers writer too
int startPosition = ownerWriter.Position; 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); ownerWriter.WriteByte((byte)i);
// serialize into ownerWriter first // serialize into ownerWriter first