Skip to content

Commit b035925

Browse files
committed
Added comments to FormattedSyncedVarData methods to clarify their functionality
1 parent b2b961a commit b035925

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

MLAPI/MonoBehaviours/Core/NetworkedObject.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,11 @@ internal static void InvokeSyncvarUpdate()
310310
}
311311
}
312312

313+
//Writes SyncedVar data in a formatted way so taht the SetFormattedSyncedVarData method can read it.
314+
//The format doesn't NECCECARLY correspond with the "general syncedVar message layout"
315+
//as this should only be used for reading SyncedVar data that is to be read by the SetFormattedData method
316+
//*
317+
//The data contains every syncedvar on every behaviour that belongs to this object
313318
internal void WriteFormattedSyncedVarData(BitWriter writer)
314319
{
315320
for (int i = 0; i < childNetworkedBehaviours.Count; i++)
@@ -325,6 +330,7 @@ internal void WriteFormattedSyncedVarData(BitWriter writer)
325330
}
326331
}
327332

333+
//Reads formatted data that the "WriteFormattedSyncedVarData" has written and applies the values to SyncedVar fields
328334
internal void SetFormattedSyncedVarData(BitReader reader)
329335
{
330336
for (int i = 0; i < childNetworkedBehaviours.Count; i++)
@@ -342,7 +348,7 @@ internal void SetFormattedSyncedVarData(BitReader reader)
342348
}
343349
}
344350

345-
//Flushes all syncVars to client
351+
//Forces a SycnedVar update to a specific client.
346352
internal void FlushSyncedVarsToClient(uint clientId)
347353
{
348354
for (int i = 0; i < childNetworkedBehaviours.Count; i++)

0 commit comments

Comments
 (0)