add comments

This commit is contained in:
vis2k 2021-07-07 12:23:29 +08:00
parent 80387ffa03
commit 92d4429c55
2 changed files with 2 additions and 0 deletions

View File

@ -940,6 +940,7 @@ internal void OnSerializeAllSafely(bool initialState, NetworkWriter ownerWriter,
} }
// get cached serialization for this tick (or serialize if none yet) // get cached serialization for this tick (or serialize if none yet)
// IMPORTANT: needs FRAME TIME which doesn't change during THIS FRAME!
internal NetworkIdentitySerialization GetSerializationAtTick(float tickTimeStamp) internal NetworkIdentitySerialization GetSerializationAtTick(float tickTimeStamp)
{ {
// serialize fresh if tick is newer than last one // serialize fresh if tick is newer than last one

View File

@ -1432,6 +1432,7 @@ public static void RebuildObservers(NetworkIdentity identity, bool initialize)
static NetworkWriter GetEntitySerializationForConnection(NetworkIdentity identity, NetworkConnectionToClient connection) static NetworkWriter GetEntitySerializationForConnection(NetworkIdentity identity, NetworkConnectionToClient connection)
{ {
// get serialization for this entity (cached) // get serialization for this entity (cached)
// IMPORTANT: needs FRAME TIME which doesn't change during THIS FRAME!
NetworkIdentitySerialization serialization = identity.GetSerializationAtTick(Time.time); NetworkIdentitySerialization serialization = identity.GetSerializationAtTick(Time.time);
// is this entity owned by this connection? // is this entity owned by this connection?