@@ -66,7 +66,7 @@ public class NetworkTransform : NetworkBehaviour
6666 /// - The teleporting state update.
6767 /// - When using half float precision and the `NetworkDeltaPosition` delta exceeds the maximum delta forcing the axis in
6868 /// question to be collapsed into the core base position, this state update will be sent as reliable fragmented sequenced.
69- ///
69+ ///
7070 /// In order to preserve a continual consistency of axial values when unreliable delta messaging is enabled (due to the
7171 /// possibility of dropping packets), NetworkTransform instances will send 1 axial frame synchronization update per
7272 /// second (only for the axis marked to synchronize are sent as reliable fragmented sequenced) as long as a delta state
@@ -104,7 +104,7 @@ public struct NetworkTransformState : INetworkSerializable
104104 private const int k_ReliableSequenced = 0x00080000 ;
105105 private const int k_UseUnreliableDeltas = 0x00100000 ;
106106 private const int k_UnreliableFrameSync = 0x00200000 ;
107- private const int k_TrackStateId = 0x10000000 ; // (Internal Debugging) When set each state update will contain a state identifier
107+ private const int k_TrackStateId = 0x10000000 ; // (Internal Debugging) When set each state update will contain a state identifier
108108
109109 // Stores persistent and state relative flags
110110 private uint m_Bitset ;
@@ -459,10 +459,11 @@ internal set
459459 }
460460
461461 /// <summary>
462- /// Returns whether this state update was a frame synchronization when
463- /// UseUnreliableDeltas is enabled. When set, the entire transform will
462+ /// Returns whether this state update was a frame synchronization when
463+ /// UseUnreliableDeltas is enabled. When set, the entire transform will
464464 /// be or has been synchronized.
465465 /// </summary>
466+ /// <returns><see cref="true"/> if this state update was a frame synchronization; otherwise, <see cref="false"/>.</returns>
466467 public bool IsUnreliableFrameSync ( )
467468 {
468469 return UnreliableFrameSync ;
@@ -475,6 +476,7 @@ public bool IsUnreliableFrameSync()
475476 /// <remarks>
476477 /// Unreliable delivery will only be used if <see cref="UseUnreliableDeltas"/> is set.
477478 /// </remarks>
479+ /// <returns><see cref="true"/> if this state was sent with reliable delivery; otherwise, <see cref="false"/>.</returns>
478480 public bool IsReliableStateUpdate ( )
479481 {
480482 return ReliableSequenced ;
@@ -586,7 +588,7 @@ public Quaternion GetRotation()
586588 /// <remarks>
587589 /// When there is no change in an updated state's position then there are no values to return.
588590 /// Checking for <see cref="HasPositionChange"/> is one way to detect this.
589- /// When used with half precision it returns the half precision delta position state update
591+ /// When used with half precision it returns the half precision delta position state update
590592 /// which will not be the full position.
591593 /// To get a NettworkTransform's full position, use <see cref="GetSpaceRelativePosition(bool)"/> and
592594 /// pass true as the parameter.
@@ -661,6 +663,8 @@ public int GetNetworkTick()
661663 /// <summary>
662664 /// Serializes this <see cref="NetworkTransformState"/>
663665 /// </summary>
666+ /// <typeparam name="T">The type of the serializer.</typeparam>
667+ /// <param name="serializer">The serializer used for reading or writing the state.</param>
664668 public void NetworkSerialize < T > ( BufferSerializer < T > serializer ) where T : IReaderWriter
665669 {
666670 // Used to calculate the LastSerializedSize value
@@ -897,7 +901,7 @@ public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReade
897901 if ( HasScaleChange )
898902 {
899903 // If we are teleporting (which includes synchronizing) and the associated NetworkObject has a parent
900- // then we want to serialize the LossyScale since NetworkObject spawn order is not guaranteed
904+ // then we want to serialize the LossyScale since NetworkObject spawn order is not guaranteed
901905 if ( IsTeleportingNextFrame && IsParented )
902906 {
903907 serializer . SerializeValue ( ref LossyScale ) ;
@@ -1419,9 +1423,8 @@ private bool ShouldSynchronizeHalfFloat(ulong targetClientId)
14191423 /// <remarks>
14201424 /// If a derived class overrides this, then make sure to invoke this base method!
14211425 /// </remarks>
1422- /// <typeparam name="T"></typeparam>
1423- /// <param name="serializer"></param>
1424- /// <param name="targetClientId">the clientId being synchronized (both reading and writing)</param>
1426+ /// <typeparam name="T">The type of the serializer.</typeparam>
1427+ /// <param name="serializer">The serializer used for reading or writing the state.</param>
14251428 protected override void OnSynchronize < T > ( ref BufferSerializer < T > serializer )
14261429 {
14271430 m_CachedNetworkManager = NetworkManager ;
@@ -1575,11 +1578,11 @@ private void TryCommitTransform(ref Transform transformToCommit, bool synchroniz
15751578 Debug . LogException ( ex ) ;
15761579 }
15771580
1578- // The below is part of assuring we only send a frame synch, when sending unreliable deltas, if
1581+ // The below is part of assuring we only send a frame synch, when sending unreliable deltas, if
15791582 // we have already sent at least one unreliable delta state update. At this point in the callstack,
15801583 // a delta state update has just been sent in the above UpdateTransformState() call and as long as
15811584 // we didn't send a frame synch and we are not synchronizing then we know at least one unreliable
1582- // delta has been sent. Under this scenario, we should start checking for this instance's alloted
1585+ // delta has been sent. Under this scenario, we should start checking for this instance's alloted
15831586 // frame synch "tick slot". Once we send a frame synch, if no other deltas occur after that
15841587 // (i.e. the object is at rest) then we will stop sending frame synch's until the object begins
15851588 // moving, rotating, or scaling again.
@@ -1862,7 +1865,7 @@ private bool ApplyTransformToNetworkStateWithInfo(ref NetworkTransformState netw
18621865
18631866 networkState . NetworkDeltaPosition = m_HalfPositionState ;
18641867
1865- // If ownership offset is greater or we are doing an axial synchronization then synchronize the base position
1868+ // If ownership offset is greater or we are doing an axial synchronization then synchronize the base position
18661869 if ( ( m_HalfFloatTargetTickOwnership > m_CachedNetworkManager . ServerTime . Tick || isAxisSync ) && ! networkState . IsTeleportingNextFrame )
18671870 {
18681871 networkState . SynchronizeBaseHalfFloat = true ;
@@ -2056,6 +2059,10 @@ private bool ApplyTransformToNetworkStateWithInfo(ref NetworkTransformState netw
20562059 return isDirty ;
20572060 }
20582061
2062+ /// <summary>
2063+ /// Invoked whenever the transform has been updated.
2064+ /// This method can be overridden to handle any custom logic that needs to occur after the transform has been updated.
2065+ /// </summary>
20592066 protected virtual void OnTransformUpdated ( )
20602067 {
20612068
@@ -2602,6 +2609,10 @@ protected virtual void OnNetworkTransformStateUpdated(ref NetworkTransformState
26022609
26032610 }
26042611
2612+ /// <summary>
2613+ /// Invoked just before the transform state is updated.
2614+ /// This method can be overridden to handle any custom logic that needs to occur before the transform state is updated.
2615+ /// </summary>
26052616 protected virtual void OnBeforeUpdateTransformState ( )
26062617 {
26072618
@@ -2816,6 +2827,12 @@ public override void OnGainedOwnership()
28162827 base . OnGainedOwnership ( ) ;
28172828 }
28182829
2830+ /// <summary>
2831+ /// Invoked when the ownership of the <see cref="NetworkObject"/> changes.
2832+ /// This method handles reinitialization when the local client gains or loses ownership of the <see cref="NetworkObject"/>.
2833+ /// </summary>
2834+ /// <param name="previous">The client ID of the previous owner.</param>
2835+ /// <param name="current">The client ID of the new owner.</param>
28192836 protected override void OnOwnershipChanged ( ulong previous , ulong current )
28202837 {
28212838 // If we were the previous owner or the newly assigned owner then reinitialize
@@ -2842,7 +2859,7 @@ protected virtual void OnInitialize(ref NetworkTransformState replicatedState)
28422859 /// This method is only invoked by the owner
28432860 /// Use: OnInitialize(ref NetworkTransformState replicatedState) to be notified on all instances
28442861 /// </summary>
2845- /// <param name="replicatedState"></param>
2862+ /// <param name="replicatedState">The current <see cref="NetworkVariable{NetworkTransformState}"/> after initializing. </param>
28462863 protected virtual void OnInitialize ( ref NetworkVariable < NetworkTransformState > replicatedState )
28472864 {
28482865
@@ -2851,9 +2868,9 @@ protected virtual void OnInitialize(ref NetworkVariable<NetworkTransformState> r
28512868 private int m_HalfFloatTargetTickOwnership ;
28522869
28532870 /// <summary>
2854- /// The internal initialzation method to allow for internal API adjustments
2871+ /// The internal initialization method to allow for internal API adjustments
28552872 /// </summary>
2856- /// <param name="isOwnershipChange"></param>
2873+ /// <param name="isOwnershipChange">Indicates whether the initialization is due to an ownership change. </param>
28572874 private void InternalInitialization ( bool isOwnershipChange = false )
28582875 {
28592876 if ( ! IsSpawned )
@@ -2956,11 +2973,11 @@ public override void OnNetworkObjectParentChanged(NetworkObject parentNetworkObj
29562973 /// The parameters are broken up into pos / rot / scale on purpose so that the caller can perturb
29572974 /// just the desired one(s)
29582975 /// </summary>
2959- /// <param name="posIn"></param> new position to move to. Can be null
2960- /// <param name="rotIn"></param> new rotation to rotate to. Can be null
2976+ /// <param name="posIn">new position to move to. Can be null.</param>
2977+ /// <param name="rotIn">new rotation to rotate to. Can be null.</param>
29612978 /// <param name="scaleIn">new scale to scale to. Can be null</param>
29622979 /// <param name="teleportDisabled">When true (the default) the <see cref="NetworkObject"/> will not be teleported and, if enabled, will interpolate. When false the <see cref="NetworkObject"/> will teleport/apply the parameters provided immediately.</param>
2963- /// <exception cref="Exception"></exception>
2980+ /// <exception cref="Exception">Thrown when the function is called on non-spawned object or, when it's called without proper authority </exception>
29642981 public void SetState ( Vector3 ? posIn = null , Quaternion ? rotIn = null , Vector3 ? scaleIn = null , bool teleportDisabled = true )
29652982 {
29662983 if ( ! IsSpawned )
@@ -3023,7 +3040,7 @@ private void SetStateInternal(Vector3 pos, Quaternion rot, Vector3 scale, bool s
30233040
30243041 var transformToCommit = transform ;
30253042
3026- // Explicit set states are cumulative during a fractional tick period of time (i.e. each SetState invocation will
3043+ // Explicit set states are cumulative during a fractional tick period of time (i.e. each SetState invocation will
30273044 // update the axial deltas to whatever changes are applied). As such, we need to preserve the dirty and explicit
30283045 // state flags.
30293046 var stateWasDirty = m_LocalAuthoritativeNetworkState . IsDirty ;
@@ -3111,7 +3128,9 @@ private void UpdateInterpolation()
31113128 }
31123129 }
31133130
3114- /// <inheritdoc/>
3131+ /// <summary>
3132+ /// This method is called once per frame.
3133+ /// </summary>
31153134 /// <remarks>
31163135 /// If you override this method, be sure that:
31173136 /// - Non-authority always invokes this base class method.
@@ -3134,10 +3153,10 @@ protected virtual void Update()
31343153 /// <summary>
31353154 /// Teleport the transform to the given values without interpolating
31363155 /// </summary>
3137- /// <param name="newPosition"></param> new position to move to.
3138- /// <param name="newRotation"></param> new rotation to rotate to.
3156+ /// <param name="newPosition">new position to move to.</param>
3157+ /// <param name="newRotation">new rotation to rotate to.</param>
31393158 /// <param name="newScale">new scale to scale to.</param>
3140- /// <exception cref="Exception"></exception>
3159+ /// <exception cref="Exception">Thrown if teleporting is attempted on a non-authoritative side. </exception>
31413160 public void Teleport ( Vector3 newPosition , Quaternion newRotation , Vector3 newScale )
31423161 {
31433162 if ( ! CanCommitToTransform )
0 commit comments