Skip to content

Commit bef6418

Browse files
style
Updating comments for clarity
1 parent ff196a3 commit bef6418

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

‎com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3716,13 +3716,15 @@ private void ResetInterpolatedStateToCurrentAuthoritativeState()
37163716
}
37173717

37183718
/// <summary>
3719-
/// Determines whether any <see cref="NetworkTransform"/> on this <see cref="NetworkObject"/> is non-authority.
3719+
/// Returns whether any <see cref="NetworkTransform"/> on this <see cref="NetworkObject"/> is non-authority.
37203720
/// </summary>
3721-
/// <remarks>
3722-
/// Authority is derived the same way <see cref="InternalInitialization"/> derives it rather than read from
3723-
/// <see cref="CanCommitToTransform"/>, so the result does not depend upon the order in which the nested
3724-
/// <see cref="NetworkTransform"/> components are initialized.
3725-
/// </remarks>
3721+
3722+
private void Thing() { }
3723+
3724+
/// <summary>
3725+
/// Determines if this <see cref="NetworkObject"/> has any <see cref="NetworkTransform"/> instances that are non-authority.
3726+
/// </summary>
3727+
/// <returns>true if a non-authority NetworkTransform exists on this NetworkObject and false if there are none.</returns>
37263728
private bool HasNonAuthorityNetworkTransform()
37273729
{
37283730
var networkTransforms = NetworkObject.NetworkTransforms;
@@ -3799,9 +3801,8 @@ private void InternalInitialization(bool isOwnershipChange = false)
37993801

38003802
if (CanCommitToTransform)
38013803
{
3802-
// Make sure authority doesn't get added to updates (no need to do this on the authority side), but the
3803-
// registration is per-NetworkObject while the authority motion model is per-NetworkTransform. Nested
3804-
// instances with the inverted authority mode still need the update.
3804+
// If there are no non-authority NetworkTransform instances on this NetworkObject, then remove this instance from the NetworkManager's update list.
3805+
// Otherwise, we need to keep it registered for updates so the non-authority instances will process their received state updates and apply them to the transform.
38053806
if (!HasNonAuthorityNetworkTransform())
38063807
{
38073808
m_CachedNetworkManager.NetworkTransformRegistration(NetworkObject, forUpdate, false);

0 commit comments

Comments
 (0)