Skip to content

Commit fae73a5

Browse files
committed
more corrections
1 parent 2f2cada commit fae73a5

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ public T AuthoritativeValue
259259

260260
private SmoothDelegate m_SmoothDelegate = null;
261261

262+
/// <summary>
263+
/// Initializes a new instance of the AnticipatedNetworkVariable class
264+
/// </summary>
265+
/// <param name="value">The initial value for the network variable. Defaults to the type's default value if not specified.</param>
266+
/// <param name="staleDataHandling">Determines how the variable handles authoritative updates that are older than the current anticipated state. Defaults to StaleDataHandling.Ignore.</param>
262267
public AnticipatedNetworkVariable(T value = default,
263268
StaleDataHandling staleDataHandling = StaleDataHandling.Ignore)
264269
: base()
@@ -334,6 +339,9 @@ public override void Dispose()
334339
}
335340
}
336341

342+
/// <summary>
343+
/// Finalizer that ensures proper cleanup of network variable resources
344+
/// </summary>
337345
~AnticipatedNetworkVariable()
338346
{
339347
Dispose();

com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void Reset(T value = default)
106106
// The introduction of standard .NET collections caused an issue with permissions since there is no way to detect changes in the
107107
// collection without doing a full comparison. While this approach does consume more memory per collection instance, it is the
108108
// lowest risk approach to resolving the issue where a client with no write permissions could make changes to a collection locally
109-
// which can cause a myriad of issues.
109+
// which can cause a myriad of issues.
110110
private protected T m_InternalOriginalValue;
111111

112112
private protected T m_PreviousValue;
@@ -151,11 +151,12 @@ public virtual T Value
151151
/// Invoke this method to check if a collection's items are dirty.
152152
/// The default behavior is to exit early if the <see cref="NetworkVariable{T}"/> is already dirty.
153153
/// </summary>
154+
/// <param name="forceCheck"> when true, this check will force a full item collection check even if the NetworkVariable is already dirty</param>
155+
/// <returns>True if the variable is dirty and needs synchronization, false if clean or client lacks write permissions</returns>
154156
/// <remarks>
155157
/// This is to be used as a way to check if a <see cref="NetworkVariable{T}"/> containing a managed collection has any changees to the collection items.<br />
156158
/// If you invoked this when a collection is dirty, it will not trigger the <see cref="OnValueChanged"/> unless you set forceCheck param to true. <br />
157159
/// </remarks>
158-
/// <param name="forceCheck"> when true, this check will force a full item collection check even if the NetworkVariable is already dirty</param>
159160
public bool CheckDirtyState(bool forceCheck = false)
160161
{
161162
var isDirty = base.IsDirty();
@@ -333,7 +334,7 @@ public override void ReadDelta(FastBufferReader reader, bool keepDirtyDelta)
333334
/// This should be always invoked (client & server) to assure the previous values are set
334335
/// !! IMPORTANT !!
335336
/// When a server forwards delta updates to connected clients, it needs to preserve the previous dirty value(s)
336-
/// until it is done serializing all valid NetworkVariable field deltas (relative to each client). This is invoked
337+
/// until it is done serializing all valid NetworkVariable field deltas (relative to each client). This is invoked
337338
/// after it is done forwarding the deltas at the end of the <see cref="NetworkVariableDeltaMessage.Handle(ref NetworkContext)"/> method.
338339
/// </summary>
339340
internal override void PostDeltaRead()

0 commit comments

Comments
 (0)