diff --git a/.yamato/package-pack.yml b/.yamato/package-pack.yml
index cc85801042..a9ab902847 100644
--- a/.yamato/package-pack.yml
+++ b/.yamato/package-pack.yml
@@ -12,12 +12,16 @@ package_pack_-_ngo_{{ platform.name }}:
image: {{ platform.image }}
flavor: {{ platform.flavor }}
timeout: 0.25
+ variables:
+ XRAY_PROFILE: "supported ./pvpExceptions.json"
commands:
- - npm install -g upm-ci-utils@stable --registry https://artifactory.prd.it.unity3d.com/artifactory/api/npm/upm-npm
- - upm-ci package pack --package-path com.unity.netcode.gameobjects
- - upm-pvp xray --packages "upm-ci~/packages/*.tgz" --results upm-ci~/xray
- - upm-pvp require "supported rme com.unity.netcode.gameobjects/pvpExceptions.json" --allow-missing --results upm-ci~/xray --exemptions upm-ci~/xray/new-exemptions.json
+ - upm-pvp pack "com.unity.netcode.gameobjects" --output upm-ci~/packages
+ - upm-pvp xray --packages "upm-ci~/packages/com.unity.netcode.gameobjects*.tgz" --results pvp-results
+ - upm-pvp require {% if platform.name == "win" %}"%XRAY_PROFILE%"{% else %}"$XRAY_PROFILE"{% endif %} --results pvp-results --allow-missing
artifacts:
+ logs:
+ paths:
+ - "pvp-results/*"
packages:
paths:
- "upm-ci~/**"
diff --git a/.yamato/package-tests.yml b/.yamato/package-tests.yml
index 0b3eb31109..5373551ca2 100644
--- a/.yamato/package-tests.yml
+++ b/.yamato/package-tests.yml
@@ -12,14 +12,30 @@ package_test_-_ngo_{{ editor }}_{{ platform.name }}:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor }}
+ variables:
+ XRAY_PROFILE: "supported ./pvpExceptions.json"
+ UNITY_EXT_LOGGING: 1
commands:
- - npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- unity-downloader-cli -u {{ editor }} -c Editor --fast --wait
- - {% if platform.name == "ubuntu" %}DISPLAY=:0 {% endif %}upm-ci package test -u {{ editor }} --package-path com.unity.netcode.gameobjects --type package-tests --extra-utr-arg="--extra-editor-arg=-testCategory --extra-editor-arg=!Performance --reruncount=1 --clean-library-on-rerun"
+ # Platform specific UTR setup
+ - |
+{% if platform.name == "win" %}
+ curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat
+{% else %}
+ curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr
+{% endif %}
+
+ # Validate packages.
+ - upm-pvp test --unity .Editor --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --results pvp-results
+ - upm-pvp require {% if platform.name == "win" %}"%XRAY_PROFILE%"{% else %}"$XRAY_PROFILE"{% endif %} --results pvp-results
+ # Run UTR to test packages.
+ - upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --unity .Editor
+ - {% if platform.name == "ubuntu" %}DISPLAY=:0 {% endif %} {% if platform.name == "win" %} utr.bat {% else %} ./utr {% endif %} --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --artifacts-path=test-results "--ff={ops.upmpvpevidence.enable=true}" --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --reruncount=1 --clean-library-on-rerun
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
+ - "pvp-results/*"
dependencies:
- .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }}
{% endfor -%}
diff --git a/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs b/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs
index f39bda43b8..279592184f 100644
--- a/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs
+++ b/com.unity.netcode.gameobjects/Components/AnticipatedNetworkTransform.cs
@@ -13,24 +13,24 @@ namespace Unity.Netcode.Components
///
///
///
- /// - Snap: In this mode (with set to
+ ///
- Snap: In this mode (with set to
/// and no callback),
/// the moment a more up-to-date value is received from the authority, it will simply replace the anticipated value,
- /// resulting in a "snap" to the new value if it is different from the anticipated value.
+ /// resulting in a "snap" to the new value if it is different from the anticipated value.
///
- /// - Smooth: In this mode (with set to
+ ///
- Smooth: In this mode (with set to
/// and an callback that calls
/// from the anticipated value to the authority value with an appropriate
/// -style smooth function), when a more up-to-date value is received from the authority,
- /// it will interpolate over time from an incorrect anticipated value to the correct authoritative value.
+ /// it will interpolate over time from an incorrect anticipated value to the correct authoritative value.
///
- /// - Constant Reanticipation: In this mode (with set to
+ ///
- Constant Reanticipation: In this mode (with set to
/// and an that calculates a
/// new anticipated value based on the current authoritative value), when a more up-to-date value is received from
/// the authority, user code calculates a new anticipated value, possibly calling to interpolate
/// between the previous anticipation and the new anticipation. This is useful for values that change frequently and
/// need to constantly be re-evaluated, as opposed to values that change only in response to user action and simply
- /// need a one-time anticipation when the user performs that action.
+ /// need a one-time anticipation when the user performs that action.
///
///
///
@@ -135,7 +135,7 @@ public bool ShouldReanticipate
/// Anticipate that, at the end of one round trip to the server, this transform will be in the given
///
///
- ///
+ /// The anticipated position
public void AnticipateMove(Vector3 newPosition)
{
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
@@ -162,7 +162,7 @@ public void AnticipateMove(Vector3 newPosition)
/// Anticipate that, at the end of one round trip to the server, this transform will have the given
///
///
- ///
+ /// The anticipated rotation
public void AnticipateRotate(Quaternion newRotation)
{
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
@@ -189,7 +189,7 @@ public void AnticipateRotate(Quaternion newRotation)
/// Anticipate that, at the end of one round trip to the server, this transform will have the given
///
///
- ///
+ /// The anticipated scale
public void AnticipateScale(Vector3 newScale)
{
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
@@ -216,7 +216,7 @@ public void AnticipateScale(Vector3 newScale)
/// Anticipate that, at the end of one round trip to the server, the transform will have the given
///
///
- ///
+ /// The anticipated transform state
public void AnticipateState(TransformState newState)
{
if (NetworkManager.ShutdownInProgress || !NetworkManager.IsListening)
@@ -405,9 +405,9 @@ public override void OnDestroy()
/// over of real time. The duration uses
/// , so it is affected by .
///
- ///
- ///
- ///
+ /// Starting transform state
+ /// Target transform state
+ /// Interpolation time in seconds
public void Smooth(TransformState from, TransformState to, float durationSeconds)
{
var transform_ = transform;
diff --git a/com.unity.netcode.gameobjects/Components/HalfVector3.cs b/com.unity.netcode.gameobjects/Components/HalfVector3.cs
index 679496452c..48ae12196f 100644
--- a/com.unity.netcode.gameobjects/Components/HalfVector3.cs
+++ b/com.unity.netcode.gameobjects/Components/HalfVector3.cs
@@ -8,7 +8,7 @@ namespace Unity.Netcode.Components
/// Half float precision .
///
///
- /// The Vector3T values are half float values returned by for each
+ /// The Vector3T{ushort} values are half float values returned by for each
/// individual axis and the 16 bits of the half float are stored as values since C# does not have
/// a half float type.
///
@@ -129,7 +129,7 @@ public void UpdateFrom(ref Vector3 vector3)
/// Constructor
///
/// The initial axial values (converted to half floats) when instantiated.
- /// The axis to synchronize.
+ /// The axis to synchronize.
public HalfVector3(Vector3 vector3, bool3 axisToSynchronize)
{
Axis = half3.zero;
diff --git a/com.unity.netcode.gameobjects/Components/HalfVector4.cs b/com.unity.netcode.gameobjects/Components/HalfVector4.cs
index 35ba13859a..03702f0eed 100644
--- a/com.unity.netcode.gameobjects/Components/HalfVector4.cs
+++ b/com.unity.netcode.gameobjects/Components/HalfVector4.cs
@@ -8,7 +8,7 @@ namespace Unity.Netcode.Components
/// Half Precision that can also be used to convert a to half precision.
///
///
- /// The Vector4T values are half float values returned by for each
+ /// The Vector4T{ushort} values are half float values returned by for each
/// individual axis and the 16 bits of the half float are stored as values since C# does not have
/// a half float type.
///
diff --git a/com.unity.netcode.gameobjects/Components/Interpolator/BufferedLinearInterpolator.cs b/com.unity.netcode.gameobjects/Components/Interpolator/BufferedLinearInterpolator.cs
index a9389424cc..15e50104be 100644
--- a/com.unity.netcode.gameobjects/Components/Interpolator/BufferedLinearInterpolator.cs
+++ b/com.unity.netcode.gameobjects/Components/Interpolator/BufferedLinearInterpolator.cs
@@ -352,7 +352,7 @@ protected override Quaternion Interpolate(Quaternion start, Quaternion end, floa
}
///
- /// A implementation.
+ /// A implementation.
///
public class BufferedLinearInterpolatorVector3 : BufferedLinearInterpolator
{
diff --git a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs
index a5abeb0c99..f8bd23f0db 100644
--- a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs
+++ b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs
@@ -39,7 +39,7 @@ public class NetworkTransformEditor : UnityEditor.Editor
public virtual bool HideInterpolateValue => false;
- ///
+ ///
public void OnEnable()
{
m_UseUnreliableDeltas = serializedObject.FindProperty(nameof(NetworkTransform.UseUnreliableDeltas));
diff --git a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs
index 9b855ec5ba..7c3cb964af 100644
--- a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs
@@ -152,7 +152,7 @@ public class NetworkConfig
///
/// Returns a base64 encoded version of the configuration
///
- ///
+ /// base64 encoded string containing the serialized network configuration
public string ToBase64()
{
NetworkConfig config = this;
@@ -219,8 +219,8 @@ internal void ClearConfigHash()
///
/// Gets a SHA256 hash of parts of the NetworkConfig instance
///
- ///
- ///
+ /// When true, caches the computed hash value for future retrievals, when false, always recomputes the hash
+ /// A 64-bit hash value representing the configuration state
public ulong GetConfig(bool cache = true)
{
if (m_ConfigHash != null && cache)
@@ -264,8 +264,11 @@ public ulong GetConfig(bool cache = true)
///
/// Compares a SHA256 hash with the current NetworkConfig instances hash
///
- ///
- ///
+ /// The 64-bit hash value to compare against this configuration's hash
+ ///
+ /// True if the hashes match, indicating compatible configurations.
+ /// False if the hashes differ, indicating potentially incompatible configurations.
+ ///
public bool CompareConfig(ulong hash)
{
return hash == GetConfig();
diff --git a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabsList.cs b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabsList.cs
index 1c4719120a..5003a2fe4e 100644
--- a/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabsList.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabsList.cs
@@ -38,7 +38,7 @@ public class NetworkPrefabsList : ScriptableObject
/// Adds a prefab to the prefab list. Performing this here will apply the operation to all
/// s that reference this list.
///
- ///
+ /// The NetworkPrefab to add to the shared list
public void Add(NetworkPrefab prefab)
{
List.Add(prefab);
@@ -49,7 +49,7 @@ public void Add(NetworkPrefab prefab)
/// Removes a prefab from the prefab list. Performing this here will apply the operation to all
/// s that reference this list.
///
- ///
+ /// The NetworkPrefab to remove from the shared list
public void Remove(NetworkPrefab prefab)
{
List.Remove(prefab);
diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs
index f2581890df..429259c9cb 100644
--- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs
@@ -480,15 +480,19 @@ public struct ConnectionApprovalRequest
///
/// This callback is invoked once the local server is stopped.
///
- /// The bool parameter will be set to true when stopping a host instance and false when stopping a server instance.
- /// The first parameter of this event will be set to when stopping a host instance and when stopping a server instance.
+ ///
+ /// The bool parameter will be set to true when stopping a host instance and false when stopping a server instance.
+ /// The first parameter of this event will be set to when stopping a host instance and when stopping a server instance.
+ ///
public event Action OnServerStopped = null;
///
/// The callback to invoke once the local client stops.
///
- /// The bool parameter will be set to true when stopping a host client and false when stopping a standard client instance.
- /// The first parameter of this event will be set to when stopping the host client and when stopping a standard client instance.
+ ///
+ /// The bool parameter will be set to true when stopping a host client and false when stopping a standard client instance.
+ /// The first parameter of this event will be set to when stopping the host client and when stopping a standard client instance.
+ ///
public event Action OnClientStopped = null;
///
@@ -757,14 +761,14 @@ private void OnEnable()
///
///
///
- ///
- ///
+ /// The GameObject prefab to be registered. Must not be null and must have a NetworkObject component.
+ /// Thrown when the prefab is null or missing required components.
public void AddNetworkPrefab(GameObject prefab) => PrefabHandler.AddNetworkPrefab(prefab);
///
///
///
- ///
+ /// The GameObject prefab to be unregistered. Must not be null and must have been previously registered.
public void RemoveNetworkPrefab(GameObject prefab) => PrefabHandler.RemoveNetworkPrefab(prefab);
///
@@ -776,7 +780,6 @@ private void OnEnable()
/// and thus should be large enough to ensure it can hold each message type.
/// This value defaults to 1296.
///
- ///
public int MaximumTransmissionUnitSize
{
set => MessageManager.NonFragmentedMessageMaxSize = value & ~7; // Round down to nearest word aligned size
@@ -788,8 +791,8 @@ public int MaximumTransmissionUnitSize
/// This determines the maximum size of a message batch that can be sent to that client.
/// If not set for any given client, will be used instead.
///
- ///
- ///
+ /// The unique identifier of the client to set the MTU for.
+ /// The maximum transmission unit size in bytes for this specific client.
public void SetPeerMTU(ulong clientId, int size)
{
MessageManager.PeerMTUSizes[clientId] = size;
@@ -799,8 +802,8 @@ public void SetPeerMTU(ulong clientId, int size)
/// Queries the current MTU size for a client.
/// If no MTU has been set for that client, will return
///
- ///
- ///
+ /// The unique identifier of the client to query.
+ /// The MTU size in bytes for the specified client. If no MTU has been set for that client, returns .
public int GetPeerMTU(ulong clientId)
{
if (MessageManager.PeerMTUSizes.TryGetValue(clientId, out var ret))
@@ -815,7 +818,6 @@ public int GetPeerMTU(ulong clientId)
/// Sets the maximum size of a message (or message batch) passed through the transport with the ReliableFragmented delivery.
/// Warning: setting this value too low may result in the SDK becoming non-functional with projects that have a large number of NetworkBehaviours or NetworkVariables, as the SDK relies on the transport's ability to fragment some messages when they grow beyond the MTU size.
///
- ///
public int MaximumFragmentedMessageSize
{
set => MessageManager.FragmentedMessageMaxSize = value;
diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs
index 3f62c0960b..3c5551cd4b 100644
--- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs
@@ -34,7 +34,7 @@ public sealed class NetworkObject : MonoBehaviour
internal uint PrefabGlobalObjectIdHash;
///
- /// This is the source prefab of an in-scene placed NetworkObject. This is not set for in-scene
+ /// This is the source prefab of an in-scene placed NetworkObject. This is not set for in-scene
/// placd NetworkObjects that are not prefab instances, dynamically spawned prefab instances,
/// or for network prefab assets.
///
@@ -172,8 +172,8 @@ private bool IsEditingPrefab()
}
///
- /// This checks to see if this NetworkObject is an in-scene placed prefab instance. If so it will
- /// automatically find the source prefab asset's GlobalObjectIdHash value, assign it to
+ /// This checks to see if this NetworkObject is an in-scene placed prefab instance. If so it will
+ /// automatically find the source prefab asset's GlobalObjectIdHash value, assign it to
/// InScenePlacedSourceGlobalObjectIdHash and mark this as being in-scene placed.
///
///
@@ -1060,7 +1060,7 @@ internal bool TryRemoveParentCachedWorldPositionStays()
/// This is a more convenient way to remove the parent without having to cast the null value to either or
///
/// If true, the parent-relative position, scale and rotation are modified such that the object keeps the same world space position, rotation and scale as before.
- ///
+ /// True if the parent was successfully removed, false if the operation failed or if there was no parent to remove.
public bool TryRemoveParent(bool worldPositionStays = true)
{
return TrySetParent((NetworkObject)null, worldPositionStays);
diff --git a/com.unity.netcode.gameobjects/Runtime/Exceptions/InvalidParentException.cs b/com.unity.netcode.gameobjects/Runtime/Exceptions/InvalidParentException.cs
index c7ecbaa4d4..1be7048208 100644
--- a/com.unity.netcode.gameobjects/Runtime/Exceptions/InvalidParentException.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Exceptions/InvalidParentException.cs
@@ -12,13 +12,13 @@ public class InvalidParentException : Exception
///
public InvalidParentException() { }
- ///
- ///
+ ///
+ /// The message that describes the invalid parent operation
public InvalidParentException(string message) : base(message) { }
- ///
- ///
- ///
+ ///
+ /// The message that describes the invalid parent operation
+ /// The exception that caused the current exception
public InvalidParentException(string message, Exception innerException) : base(message, innerException) { }
}
}
diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs
index 6b26e5306f..a102f3666e 100644
--- a/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Messaging/GenerateSerializationForGenericParameterAttribute.cs
@@ -19,12 +19,12 @@ namespace Unity.Netcode
///
/// The parameter is indicated by index (and is 0-indexed); for example:
///
- ///
+ ///
/// [SerializesGenericParameter(1)]
/// public class MyClass<TTypeOne, TTypeTwo>
/// {
/// }
- ///
+ ///
///
/// This tells the code generation for to generate
/// serialized code for TTypeTwo (generic parameter 1).
@@ -38,32 +38,32 @@ namespace Unity.Netcode
///
/// This attribute is properly inherited by subclasses. For example:
///
- ///
+ ///
/// [SerializesGenericParameter(0)]
/// public class MyClass<T>
/// {
/// }
- ///
+ ///
/// public class MySubclass1 : MyClass<Foo>
/// {
/// }
- ///
+ ///
/// public class MySubclass2<T> : MyClass<T>
/// {
/// }
- ///
+ ///
/// [SerializesGenericParameter(1)]
/// public class MySubclass3<TTypeOne, TTypeTwo> : MyClass<TTypeOne>
/// {
/// }
- ///
+ ///
/// public class MyBehaviour : NetworkBehaviour
/// {
/// public MySubclass1 TheValue;
/// public MySubclass2<Bar> TheValue;
/// public MySubclass3<Baz, Qux> TheValue;
/// }
- ///
+ ///
///
/// The above code will trigger generation of serialization code for Foo (passed directly to the
/// base class), Bar (passed indirectly to the base class), Baz (passed indirectly to the base class),
diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/BaseRpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/BaseRpcTarget.cs
index 3f9d4f9d88..9d81bdecf9 100644
--- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/BaseRpcTarget.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/BaseRpcTarget.cs
@@ -2,8 +2,14 @@
namespace Unity.Netcode
{
+ ///
+ /// The base abstract RPC Target class used by all universal RPC targets.
+ ///
public abstract class BaseRpcTarget : IDisposable
{
+ ///
+ /// The instance which can be used to handle sending and receiving the specific target(s)
+ ///
protected NetworkManager m_NetworkManager;
private bool m_Locked;
@@ -22,6 +28,10 @@ internal BaseRpcTarget(NetworkManager manager)
m_NetworkManager = manager;
}
+ ///
+ /// Can be used to provide additional lock checks before disposing the target.
+ ///
+ /// The exception thrown if the target is still locked when disposed.
protected void CheckLockBeforeDispose()
{
if (m_Locked)
@@ -30,6 +40,9 @@ protected void CheckLockBeforeDispose()
}
}
+ ///
+ /// Invoked when the target is disposed.
+ ///
public abstract void Dispose();
internal abstract void Send(NetworkBehaviour behaviour, ref RpcMessage message, NetworkDelivery delivery, RpcParams rpcParams);
diff --git a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs
index 7d55209c15..bceb171428 100644
--- a/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs
@@ -131,6 +131,9 @@ internal RpcTarget(NetworkManager manager)
m_CachedProxyRpcTarget.Lock();
}
+ ///
+ /// Invoked when this class is disposed.
+ ///
public void Dispose()
{
Everyone.Dispose();
@@ -218,11 +221,11 @@ public void Dispose()
///
/// Send to a specific single client ID.
///
- ///
+ /// The ID of the client to send to
/// will return a cached target, which should not be stored as it will
/// be overwritten in future calls to Single(). Do not call Dispose() on Temp targets.
will
/// return a new target, which can be stored, but should not be done frequently because it results in a GC allocation. You must call Dispose() on Persistent targets when you are done with them.
- ///
+ /// A configured to send to the specified client. The type of target (cached or new instance) depends on the parameter
public BaseRpcTarget Single(ulong clientId, RpcTargetUse use)
{
if (clientId == m_NetworkManager.LocalClientId)
@@ -251,11 +254,11 @@ public BaseRpcTarget Single(ulong clientId, RpcTargetUse use)
///
/// Send to everyone EXCEPT a specific single client ID.
///
- ///
+ /// The IDs of the client to exclude from receiving the message
/// will return a cached target, which should not be stored as it will
/// be overwritten in future calls to Not() or Group(). Do not call Dispose() on Temp targets.
will
/// return a new target, which can be stored, but should not be done frequently because it results in a GC allocation. You must call Dispose() on Persistent targets when you are done with them.
- ///
+ /// A configured to send to all clients except the specified one. The type of target (cached or new instance) depends on the parameter and whether the caller is the server
public BaseRpcTarget Not(ulong excludedClientId, RpcTargetUse use)
{
IGroupRpcTarget target;
@@ -264,7 +267,7 @@ public BaseRpcTarget Not(ulong excludedClientId, RpcTargetUse use)
if (use == RpcTargetUse.Persistent)
{
target = new RpcTargetGroup(m_NetworkManager);
- }
+ } // HELLO from the dark side
else
{
target = m_CachedTargetGroup;
@@ -304,11 +307,11 @@ public BaseRpcTarget Not(ulong excludedClientId, RpcTargetUse use)
/// NativeArrays can be trivially constructed using Allocator.Temp, making this an efficient
/// Group method if the group list is dynamically constructed.
///
- ///
+ /// The IDs of the client that should receive the message.
/// will return a cached target, which should not be stored as it will
/// be overwritten in future calls to Not() or Group(). Do not call Dispose() on Temp targets.
will
/// return a new target, which can be stored, but should not be done frequently because it results in a GC allocation. You must call Dispose() on Persistent targets when you are done with them.
- ///
+ /// A configured to send to all clients except the specified one. The type of target (cached or new instance) depends on the parameter and whether the caller is the server
public BaseRpcTarget Group(NativeArray clientIds, RpcTargetUse use)
{
IGroupRpcTarget target;
@@ -348,11 +351,11 @@ public BaseRpcTarget Group(NativeArray clientIds, RpcTargetUse use)
/// NativeList can be trivially constructed using Allocator.Temp, making this an efficient
/// Group method if the group list is dynamically constructed.
///
- ///
+ /// The IDs of the client that should receive the message.
/// will return a cached target, which should not be stored as it will
/// be overwritten in future calls to Not() or Group(). Do not call Dispose() on Temp targets.
will
/// return a new target, which can be stored, but should not be done frequently because it results in a GC allocation. You must call Dispose() on Persistent targets when you are done with them.
- ///
+ /// A configured to send to all clients except the specified one. The type of target (cached or new instance) depends on the parameter and whether the caller is the server
public BaseRpcTarget Group(NativeList clientIds, RpcTargetUse use)
{
var asArray = clientIds.AsArray();
@@ -365,11 +368,11 @@ public BaseRpcTarget Group(NativeList clientIds, RpcTargetUse use)
/// if you either have no strict performance requirements, or have the group of client IDs cached so
/// it is not created each time.
///
- ///
+ /// The IDs of the client that should receive the message.
/// will return a cached target, which should not be stored as it will
/// be overwritten in future calls to Not() or Group(). Do not call Dispose() on Temp targets.
will
/// return a new target, which can be stored, but should not be done frequently because it results in a GC allocation. You must call Dispose() on Persistent targets when you are done with them.
- ///
+ /// A configured to send to all clients except the specified one. The type of target (cached or new instance) depends on the parameter and whether the caller is the server
public BaseRpcTarget Group(ulong[] clientIds, RpcTargetUse use)
{
return Group(new NativeArray(clientIds, Allocator.Temp), use);
@@ -382,11 +385,12 @@ public BaseRpcTarget Group(ulong[] clientIds, RpcTargetUse use)
/// This override is only recommended if you either have no strict performance requirements,
/// or have the group of client IDs cached so it is not created each time.
///
- ///
+ /// The type
+ /// The IDs of the client that should receive the message.
/// will return a cached target, which should not be stored as it will
/// be overwritten in future calls to Not() or Group(). Do not call Dispose() on Temp targets.
will
/// return a new target, which can be stored, but should not be done frequently because it results in a GC allocation. You must call Dispose() on Persistent targets when you are done with them.
- ///
+ /// A configured to send to all clients except the specified one. The type of target (cached or new instance) depends on the parameter and whether the caller is the server
public BaseRpcTarget Group(T clientIds, RpcTargetUse use) where T : IEnumerable
{
IGroupRpcTarget target;
@@ -426,11 +430,11 @@ public BaseRpcTarget Group(T clientIds, RpcTargetUse use) where T : IEnumerab
/// NativeArrays can be trivially constructed using Allocator.Temp, making this an efficient
/// Group method if the group list is dynamically constructed.
///
- ///
+ /// The IDs of the client to exclude from receiving the message
/// will return a cached target, which should not be stored as it will
/// be overwritten in future calls to Not() or Group(). Do not call Dispose() on Temp targets.
will
/// return a new target, which can be stored, but should not be done frequently because it results in a GC allocation. You must call Dispose() on Persistent targets when you are done with them.
- ///
+ /// A configured to send to all clients except the specified one. The type of target (cached or new instance) depends on the parameter and whether the caller is the server
public BaseRpcTarget Not(NativeArray excludedClientIds, RpcTargetUse use)
{
IGroupRpcTarget target;
@@ -486,11 +490,11 @@ public BaseRpcTarget Not(NativeArray excludedClientIds, RpcTargetUse use)
/// NativeList can be trivially constructed using Allocator.Temp, making this an efficient
/// Group method if the group list is dynamically constructed.
///
- ///
+ /// The IDs of the client to exclude from receiving the message
/// will return a cached target, which should not be stored as it will
/// be overwritten in future calls to Not() or Group(). Do not call Dispose() on Temp targets.
will
/// return a new target, which can be stored, but should not be done frequently because it results in a GC allocation. You must call Dispose() on Persistent targets when you are done with them.
- ///
+ /// A configured to send to all clients except the specified one. The type of target (cached or new instance) depends on the parameter and whether the caller is the server
public BaseRpcTarget Not(NativeList excludedClientIds, RpcTargetUse use)
{
var asArray = excludedClientIds.AsArray();
@@ -503,11 +507,11 @@ public BaseRpcTarget Not(NativeList excludedClientIds, RpcTargetUse use)
/// if you either have no strict performance requirements, or have the group of client IDs cached so
/// it is not created each time.
///
- ///
+ /// The IDs of the client to exclude from receiving the message
/// will return a cached target, which should not be stored as it will
/// be overwritten in future calls to Not() or Group(). Do not call Dispose() on Temp targets.
will
/// return a new target, which can be stored, but should not be done frequently because it results in a GC allocation. You must call Dispose() on Persistent targets when you are done with them.
- ///
+ /// A configured to send to all clients except the specified one. The type of target (cached or new instance) depends on the parameter and whether the caller is the server
public BaseRpcTarget Not(ulong[] excludedClientIds, RpcTargetUse use)
{
return Not(new NativeArray(excludedClientIds, Allocator.Temp), use);
@@ -520,11 +524,12 @@ public BaseRpcTarget Not(ulong[] excludedClientIds, RpcTargetUse use)
/// This override is only recommended if you either have no strict performance requirements,
/// or have the group of client IDs cached so it is not created each time.
///
- ///
+ /// The type
+ /// The IDs of the client to exclude from receiving the message
/// will return a cached target, which should not be stored as it will
/// be overwritten in future calls to Not() or Group(). Do not call Dispose() on Temp targets.
will
/// return a new target, which can be stored, but should not be done frequently because it results in a GC allocation. You must call Dispose() on Persistent targets when you are done with them.
- ///
+ /// A configured to send to all clients except the specified one. The type of target (cached or new instance) depends on the parameter and whether the caller is the server
public BaseRpcTarget Not(T excludedClientIds, RpcTargetUse use) where T : IEnumerable
{
IGroupRpcTarget target;
diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs
index 2a08293206..d9d4e87393 100644
--- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs
+++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/AnticipatedNetworkVariable.cs
@@ -20,24 +20,24 @@ public enum StaleDataHandling
///
///
///
- /// - Snap: In this mode (with set to
+ ///
- Snap: In this mode (with set to
/// and no callback),
/// the moment a more up-to-date value is received from the authority, it will simply replace the anticipated value,
- /// resulting in a "snap" to the new value if it is different from the anticipated value.
+ /// resulting in a "snap" to the new value if it is different from the anticipated value.
///
- /// - Smooth: In this mode (with set to
+ ///
- Smooth: In this mode (with set to
/// and an callback that calls
/// from the anticipated value to the authority value with an appropriate
/// -style smooth function), when a more up-to-date value is received from the authority,
- /// it will interpolate over time from an incorrect anticipated value to the correct authoritative value.
+ /// it will interpolate over time from an incorrect anticipated value to the correct authoritative value.
///
- /// - Constant Reanticipation: In this mode (with set to
+ ///
- Constant Reanticipation: In this mode (with set to
/// and an that calculates a
/// new anticipated value based on the current authoritative value), when a more up-to-date value is received from
/// the authority, user code calculates a new anticipated value, possibly calling to interpolate
/// between the previous anticipation and the new anticipation. This is useful for values that change frequently and
/// need to constantly be re-evaluated, as opposed to values that change only in response to user action and simply
- /// need a one-time anticipation when the user performs that action.
+ /// need a one-time anticipation when the user performs that action.
///
///
///
@@ -177,7 +177,7 @@ public bool ShouldReanticipate
/// Sets the current value of the variable on the expectation that the authority will set the variable
/// to the same value within one network round trip (i.e., in response to an RPC).
///
- ///
+ /// The anticipated value that is expected to be confirmed by the authority
public void Anticipate(T value)
{
if (m_NetworkBehaviour.NetworkManager.ShutdownInProgress || !m_NetworkBehaviour.NetworkManager.IsListening)
@@ -334,10 +334,10 @@ private void OnValueChangedInternal(T previousValue, T newValue)
/// Interpolate this variable from to over of
/// real time. The duration uses , so it is affected by .
///
- ///
- ///
- ///
- ///
+ /// The starting value for the interpolation
+ /// The target value to interpolate towards
+ /// The duration of the interpolation in seconds
+ /// A delegate that defines how the interpolation should be performed between the two values. It provides a function to interpolate between two values based on a percentage.
public void Smooth(in T from, in T to, float durationSeconds, SmoothDelegate how)
{
if (durationSeconds <= 0)
diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs
index 6469c9ee73..6d1d370316 100644
--- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs
+++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariable.cs
@@ -135,11 +135,11 @@ public virtual T Value
/// Invoke this method to check if a collection's items are dirty.
/// The default behavior is to exit early if the is already dirty.
///
- /// when true, this check will force a full item collection check even if the NetworkVariable is already dirty
///
/// This is to be used as a way to check if a containing a managed collection has any changees to the collection items.
- /// If you invoked this when a collection is dirty, it will not trigger the unless you set to true.
+ /// If you invoked this when a collection is dirty, it will not trigger the unless you set forceCheck param to true.
///
+ /// when true, this check will force a full item collection check even if the NetworkVariable is already dirty
public bool CheckDirtyState(bool forceCheck = false)
{
var isDirty = base.IsDirty();
diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs
index 4d5a3b51a0..c6db156f81 100644
--- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs
+++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs
@@ -144,7 +144,7 @@ public virtual void OnInitialize()
///
/// Sets the update traits for this network variable to determine how frequently it will send updates.
///
- ///
+ /// The new update traits to apply to this network variable
public void SetUpdateTraits(NetworkVariableUpdateTraits traits)
{
UpdateTraits = traits;
@@ -155,7 +155,7 @@ public void SetUpdateTraits(NetworkVariableUpdateTraits traits)
/// If not, no update will be sent even if the variable is dirty, unless the time since last update exceeds
/// the ' .
///
- ///
+ /// True if the variable exceeds the dirtiness threshold or the time since the last update exceeds MaxSecondsBetweenUpdates. otherwise, false
public virtual bool ExceedsDirtinessThreshold()
{
return true;
diff --git a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs
index 2d77e568ad..312363e88f 100644
--- a/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs
+++ b/com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableSerialization.cs
@@ -1425,7 +1425,7 @@ public static void InitializeSerializer_FixedStringList() where T : unmanaged
///
/// Registers a managed type that will be checked for equality using T.Equals()
///
- ///
+ /// The managed type that implements IEquatable{T}.
public static void InitializeEqualityChecker_ManagedIEquatable() where T : class, IEquatable
{
NetworkVariableSerialization.AreEqual = NetworkVariableSerialization.EqualityEqualsObject;
@@ -1434,7 +1434,7 @@ public static void InitializeEqualityChecker_ManagedIEquatable() where T : cl
///
/// Registers an unmanaged type that will be checked for equality using T.Equals()
///
- ///
+ /// The managed type that implements IEquatable{T}.
public static void InitializeEqualityChecker_UnmanagedIEquatable() where T : unmanaged, IEquatable
{
NetworkVariableSerialization.AreEqual = NetworkVariableSerialization.EqualityEquals;
@@ -1443,7 +1443,7 @@ public static void InitializeEqualityChecker_UnmanagedIEquatable() where T :
///
/// Registers an unmanaged type that will be checked for equality using T.Equals()
///
- ///
+ /// The managed type that implements IEquatable{T}.
public static void InitializeEqualityChecker_UnmanagedIEquatableArray() where T : unmanaged, IEquatable
{
NetworkVariableSerialization>.AreEqual = NetworkVariableSerialization.EqualityEqualsArray;
@@ -1451,7 +1451,7 @@ public static void InitializeEqualityChecker_UnmanagedIEquatableArray() where
///
/// Registers an unmanaged type that will be checked for equality using T.Equals()
///
- ///
+ /// The type of elements in the list.
public static void InitializeEqualityChecker_List()
{
NetworkVariableSerialization>.AreEqual = NetworkVariableSerialization.EqualityEqualsList;
@@ -1459,7 +1459,7 @@ public static void InitializeEqualityChecker_List()
///
/// Registers an unmanaged type that will be checked for equality using T.Equals()
///
- ///
+ /// The type of elements in the hash set that implements IEquatable
public static void InitializeEqualityChecker_HashSet() where T : IEquatable
{
NetworkVariableSerialization>.AreEqual = NetworkVariableSerialization.EqualityEqualsHashSet;
@@ -1467,7 +1467,8 @@ public static void InitializeEqualityChecker_HashSet() where T : IEquatable
/// Registers an unmanaged type that will be checked for equality using T.Equals()
///
- ///
+ /// The type of dictionary keys that implements IEquatable.
+ /// The type of dictionary values.
public static void InitializeEqualityChecker_Dictionary()
where TKey : IEquatable
{
@@ -1478,7 +1479,7 @@ public static void InitializeEqualityChecker_Dictionary()
///
/// Registers an unmanaged type that will be checked for equality using T.Equals()
///
- ///
+ /// The unmanaged element type that implements IEquatable{T}.
public static void InitializeEqualityChecker_UnmanagedIEquatableList() where T : unmanaged, IEquatable
{
NetworkVariableSerialization>.AreEqual = NetworkVariableSerialization.EqualityEqualsNativeList;
@@ -1486,7 +1487,7 @@ public static void InitializeEqualityChecker_UnmanagedIEquatableList() where
///
/// Registers an unmanaged type that will be checked for equality using T.Equals()
///
- ///
+ /// The unmanaged element type that implements IEquatable{T}.
public static void InitializeEqualityChecker_NativeHashSet() where T : unmanaged, IEquatable
{
NetworkVariableSerialization>.AreEqual = NetworkVariableSerialization.EqualityEqualsNativeHashSet;
@@ -1494,7 +1495,8 @@ public static void InitializeEqualityChecker_NativeHashSet() where T : unmana
///
/// Registers an unmanaged type that will be checked for equality using T.Equals()
///
- ///
+ /// The type of dictionary keys that implements IEquatable.
+ /// The type of dictionary values.
public static void InitializeEqualityChecker_NativeHashMap()
where TKey : unmanaged, IEquatable
where TVal : unmanaged
@@ -1507,7 +1509,7 @@ public static void InitializeEqualityChecker_NativeHashMap()
/// Registers an unmanaged type that will be checked for equality using memcmp and only considered
/// equal if they are bitwise equivalent in memory
///
- ///
+ /// The unmanaged type to register for comparison.
public static void InitializeEqualityChecker_UnmanagedValueEquals() where T : unmanaged
{
NetworkVariableSerialization.AreEqual = NetworkVariableSerialization.ValueEquals;
@@ -1517,7 +1519,7 @@ public static void InitializeEqualityChecker_UnmanagedValueEquals() where T :
/// Registers an unmanaged type that will be checked for equality using memcmp and only considered
/// equal if they are bitwise equivalent in memory
///
- ///
+ /// The unmanaged element type of the array.
public static void InitializeEqualityChecker_UnmanagedValueEqualsArray() where T : unmanaged
{
NetworkVariableSerialization>.AreEqual = NetworkVariableSerialization.ValueEqualsArray;
@@ -1528,7 +1530,7 @@ public static void InitializeEqualityChecker_UnmanagedValueEqualsArray() wher
/// Registers an unmanaged type that will be checked for equality using memcmp and only considered
/// equal if they are bitwise equivalent in memory
///
- ///
+ /// The unmanaged element type of the list.
public static void InitializeEqualityChecker_UnmanagedValueEqualsList() where T : unmanaged
{
NetworkVariableSerialization>.AreEqual = NetworkVariableSerialization.ValueEqualsList;
@@ -1538,7 +1540,7 @@ public static void InitializeEqualityChecker_UnmanagedValueEqualsList() where
///
/// Registers a managed type that will be checked for equality using the == operator
///
- ///
+ /// The managed class type to register for comparison.
public static void InitializeEqualityChecker_ManagedClassEquals() where T : class
{
NetworkVariableSerialization.AreEqual = NetworkVariableSerialization.ClassEquals;
@@ -1591,8 +1593,8 @@ public static class NetworkVariableSerialization
/// . is called, which, by default,
/// will throw an exception, unless you have assigned a user serialization callback to it at runtime.
///
- ///
- ///
+ /// The FastBufferWriter to write the serialized data to.
+ /// The value to serialize
public static void Write(FastBufferWriter writer, ref T value)
{
Serializer.Write(writer, ref value);
@@ -1616,8 +1618,8 @@ public static void Write(FastBufferWriter writer, ref T value)
/// . is called, which, by default,
/// will throw an exception, unless you have assigned a user deserialization callback to it at runtime.
///
- ///
- ///
+ /// The FastBufferReader to read the serialized data from.
+ /// Reference to store the deserialized value. If null for managed types, a new instance will be created.
public static void Read(FastBufferReader reader, ref T value)
{
Serializer.Read(reader, ref value);
@@ -1638,8 +1640,8 @@ public static void Read(FastBufferReader reader, ref T value)
/// . is called, which, by default,
/// will throw an exception, unless you have assigned a user serialization callback to it at runtime.
///
- ///
- ///
+ /// The FastBufferWriter to write the serialized data to.
+ /// The value to serialize
public static void WriteDelta(FastBufferWriter writer, ref T value, ref T previousValue)
{
Serializer.WriteDelta(writer, ref value, ref previousValue);
@@ -1663,8 +1665,8 @@ public static void WriteDelta(FastBufferWriter writer, ref T value, ref T previo
/// . is called, which, by default,
/// will throw an exception, unless you have assigned a user deserialization callback to it at runtime.
///
- ///
- ///
+ /// The FastBufferReader to read the serialized data from.
+ /// Reference to store the deserialized value. If null for managed types, a new instance will be created.
public static void ReadDelta(FastBufferReader reader, ref T value)
{
Serializer.ReadDelta(reader, ref value);
@@ -1687,8 +1689,8 @@ public static void ReadDelta(FastBufferReader reader, ref T value)
/// . is called, which, by default,
/// will throw an exception, unless you have assigned a user duplication callback to it at runtime.
///
- ///
- ///
+ /// The source value to duplicate
+ /// Reference to store the duplicated value. For managed types, existing instance will be reused if non-null.
public static void Duplicate(in T value, ref T duplicatedValue)
{
Serializer.Duplicate(value, ref duplicatedValue);
diff --git a/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs b/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs
index 67dab511cf..1843c65e05 100644
--- a/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs
+++ b/com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs
@@ -15,7 +15,7 @@ namespace Unity.Netcode
/// Note: This is only when is enabled.
/// *** Do not start new scene events within scene event notification callbacks.
/// See also:
- ///
+ ///
///
public class SceneEvent
{
@@ -146,10 +146,10 @@ public class NetworkSceneManager : IDisposable
///
/// The delegate callback definition for scene event notifications.
/// See also:
- ///
- ///
+ ///
+ ///
///
- ///
+ /// SceneEvent which contains information about the scene event, including type, progress, and scene details
public delegate void SceneEventDelegate(SceneEvent sceneEvent);
///
@@ -175,7 +175,7 @@ public class NetworkSceneManager : IDisposable
///
/// Delegate declaration for the OnLoad event.
/// See also:
- /// for more information
+ /// for more information
///
/// the client that is processing this event (the server will receive all of these events for every client and itself)
/// name of the scene being processed
@@ -186,7 +186,7 @@ public class NetworkSceneManager : IDisposable
///
/// Delegate declaration for the OnUnload event.
/// See also:
- /// for more information
+ /// for more information
///
/// the client that is processing this event (the server will receive all of these events for every client and itself)
/// name of the scene being processed
@@ -196,7 +196,7 @@ public class NetworkSceneManager : IDisposable
///
/// Delegate declaration for the OnSynchronize event.
/// See also:
- /// for more information
+ /// for more information
///
/// the client that is processing this event (the server will receive all of these events for every client and itself)
public delegate void OnSynchronizeDelegateHandler(ulong clientId);
@@ -204,8 +204,8 @@ public class NetworkSceneManager : IDisposable
///
/// Delegate declaration for the OnLoadEventCompleted and OnUnloadEventCompleted events.
/// See also:
- ///
- ///
+ ///
+ ///
///
/// scene pertaining to this event
/// of the associated event completed
@@ -216,7 +216,7 @@ public class NetworkSceneManager : IDisposable
///
/// Delegate declaration for the OnLoadComplete event.
/// See also:
- /// for more information
+ /// for more information
///
/// the client that is processing this event (the server will receive all of these events for every client and itself)
/// the scene name pertaining to this event
@@ -226,7 +226,7 @@ public class NetworkSceneManager : IDisposable
///
/// Delegate declaration for the OnUnloadComplete event.
/// See also:
- /// for more information
+ /// for more information
///
/// the client that is processing this event (the server will receive all of these events for every client and itself)
/// the scene name pertaining to this event
@@ -235,7 +235,7 @@ public class NetworkSceneManager : IDisposable
///
/// Delegate declaration for the OnSynchronizeComplete event.
/// See also:
- /// for more information
+ /// for more information
///
/// the client that completed this event
public delegate void OnSynchronizeCompleteDelegateHandler(ulong clientId);
@@ -750,6 +750,7 @@ public void DisableValidationWarnings(bool disabled)
///
/// This setting changes how clients handle scene loading when initially synchronizing with the server.
/// The server or host should set this value as clients will automatically be synchronized with the server (or host) side.
+ ///
///
/// LoadSceneMode.Single: All currently loaded scenes on the client will be unloaded and the
/// server's currently active scene will be loaded in single mode on the client unless it was already
@@ -782,7 +783,7 @@ internal NetworkSceneManager(NetworkManager networkManager)
// Since NetworkManager is now always migrated to the DDOL we will use this to get the DDOL scene
DontDestroyOnLoadScene = networkManager.gameObject.scene;
- // Since the server tracks loaded scenes, we need to add any currently loaded scenes on the
+ // Since the server tracks loaded scenes, we need to add any currently loaded scenes on the
// server side when the NetworkManager is started and NetworkSceneManager instantiated when
// scene management is enabled.
if (networkManager.IsServer && networkManager.NetworkConfig.EnableSceneManagement)
@@ -1152,7 +1153,7 @@ private bool OnSceneEventProgressCompleted(SceneEventProgress sceneEventProgress
/// Unloads an additively loaded scene. If you want to unload a mode loaded scene load another scene.
/// When applicable, the is delivered within the via the
///
- ///
+ /// The Unity Scene to be unloaded
/// ( means it was successful)
public SceneEventProgressStatus UnloadScene(Scene scene)
{
diff --git a/com.unity.netcode.gameobjects/Runtime/SceneManagement/SceneEventData.cs b/com.unity.netcode.gameobjects/Runtime/SceneManagement/SceneEventData.cs
index 712740ad59..77da3012d3 100644
--- a/com.unity.netcode.gameobjects/Runtime/SceneManagement/SceneEventData.cs
+++ b/com.unity.netcode.gameobjects/Runtime/SceneManagement/SceneEventData.cs
@@ -11,7 +11,7 @@ namespace Unity.Netcode
/// Used by for messages.
/// Note: This is only when is enabled.
/// See also:
- ///
+ ///
///
public enum SceneEventType : byte
{
diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/BufferSerializer.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/BufferSerializer.cs
index 85cc0909e0..faf4c960fa 100644
--- a/com.unity.netcode.gameobjects/Runtime/Serialization/BufferSerializer.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Serialization/BufferSerializer.cs
@@ -301,7 +301,6 @@ public void SerializeValue(ref T value, FastBufferWriter.ForFixedStrings unus
/// The network serializable type
/// The values to read/write
/// The allocator to use to construct the resulting NativeArray when reading
- /// An unused parameter used for enabling overload resolution of FixedStrings
public void SerializeValue(ref NativeArray value, Allocator allocator)
where T : unmanaged, INativeList, IUTF8Bytes => m_Implementation.SerializeValue(ref value, allocator);
@@ -311,7 +310,6 @@ public void SerializeValue(ref NativeArray value, Allocator allocator)
///
/// The network serializable type
/// The values to read/write
- /// An unused parameter used for enabling overload resolution of FixedStrings
public void SerializeValue(ref NativeList value)
where T : unmanaged, INativeList, IUTF8Bytes => m_Implementation.SerializeValue(ref value);
#endif
@@ -330,8 +328,8 @@ public void SerializeValue(ref NativeList value)
/// SerializeValuePreChecked methods. But note that the benefit is small and only likely to be
/// noticeable if serializing a very large number of items.
///
- ///
- ///
+ /// The number of values that will need to be read or written
+ /// True if there is sufficient space available for the specified amount, false otherwise
public bool PreCheck(int amount)
{
return m_Implementation.PreCheck(amount);
diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/BytePacker.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/BytePacker.cs
index 58b7ea1e33..b064f2dbce 100644
--- a/com.unity.netcode.gameobjects/Runtime/Serialization/BytePacker.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Serialization/BytePacker.cs
@@ -6,7 +6,7 @@ namespace Unity.Netcode
{
///
/// Utility class for packing values in serialization.
- /// to unpack packed values.
+ /// to unpack packed values.
///
public static class BytePacker
{
diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/ByteUnpacker.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/ByteUnpacker.cs
index 2d2cd88716..2c84fff991 100644
--- a/com.unity.netcode.gameobjects/Runtime/Serialization/ByteUnpacker.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Serialization/ByteUnpacker.cs
@@ -7,7 +7,7 @@ namespace Unity.Netcode
///
/// Byte Unpacking Helper Class
/// Use this class to unpack values during deserialization for values that were packed.
- /// to pack unpacked values
+ /// to pack unpacked values
///
public static class ByteUnpacker
{
@@ -282,7 +282,7 @@ public static void ReadValuePacked(FastBufferReader reader, out Quaternion rotat
/// Reads a string in a packed format
///
/// The reader to read from
- ///
+ /// string to read
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe void ReadValuePacked(FastBufferReader reader, out string s)
{
diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/FastBufferReader.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/FastBufferReader.cs
index 8adcc98790..67d787fea5 100644
--- a/com.unity.netcode.gameobjects/Runtime/Serialization/FastBufferReader.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Serialization/FastBufferReader.cs
@@ -8,9 +8,9 @@ namespace Unity.Netcode
{
///
/// Optimized class used for reading values from a byte stream
- ///
- ///
- ///
+ ///
+ ///
+ ///
///
public struct FastBufferReader : IDisposable
{
@@ -93,22 +93,22 @@ internal unsafe void CommitBitwiseReads(int amount)
///
/// Create a FastBufferReader from a NativeArray.
///
- /// A new buffer will be created using the given and the value will be copied in.
+ /// A new buffer will be created using the specified allocator and the value will be copied in.
/// FastBufferReader will then own the data.
///
- /// The exception to this is when the passed in is Allocator.None. In this scenario,
+ /// The exception to this is when the allocator passed in is Allocator.None. In this scenario,
/// ownership of the data remains with the caller and the reader will point at it directly.
/// When created with Allocator.None, FastBufferReader will allocate some internal data using
/// Allocator.Temp so it should be treated as if it's a ref struct and not allowed to outlive
/// the context in which it was created (it should neither be returned from that function nor
- /// stored anywhere in heap memory). This is true, unless the param is explicitly set
+ /// stored anywhere in heap memory). This is true, unless the internal allocator param is explicitly set
/// to i.e.: Allocator.Persistent in which case it would allow the internal data to Persist for longer, but the caller
/// should manually call Dispose() when it is no longer needed.
///
- ///
+ /// The NativeArray to create the reader from
/// The allocator type used for internal data when copying an existing buffer if other than Allocator.None is specified, that memory will be owned by this FastBufferReader instance
- ///
- ///
+ /// The number of bytes to read from the buffer. If set to -1, the entire buffer length will be used
+ /// The offset into the buffer to start reading from
/// The allocator type used for internal data when this reader points directly at a buffer owned by someone else
public unsafe FastBufferReader(NativeArray buffer, Allocator copyAllocator, int length = -1, int offset = 0, Allocator internalAllocator = Allocator.Temp)
{
@@ -168,15 +168,15 @@ public unsafe FastBufferReader(byte[] buffer, Allocator copyAllocator, int lengt
///
/// Create a FastBufferReader from an existing byte buffer.
///
- /// A new buffer will be created using the given and the value will be copied in.
+ /// A new buffer will be created using the given specified allocator and the value will be copied in.
/// FastBufferReader will then own the data.
///
- /// The exception to this is when the passed in is Allocator.None. In this scenario,
+ /// The exception to this is when the specified allocator passed in is Allocator.None. In this scenario,
/// ownership of the data remains with the caller and the reader will point at it directly.
/// When created with Allocator.None, FastBufferReader will allocate some internal data using
/// Allocator.Temp, so it should be treated as if it's a ref struct and not allowed to outlive
/// the context in which it was created (it should neither be returned from that function nor
- /// stored anywhere in heap memory). This is true, unless the param is explicitly set
+ /// stored anywhere in heap memory). This is true, unless the internal allocator param is explicitly set
/// to i.e.: Allocator.Persistent in which case it would allow the internal data to Persist for longer, but the caller
/// should manually call Dispose() when it is no longer needed.
///
@@ -193,15 +193,15 @@ public unsafe FastBufferReader(byte* buffer, Allocator copyAllocator, int length
///
/// Create a FastBufferReader from a FastBufferWriter.
///
- /// A new buffer will be created using the given and the value will be copied in.
+ /// A new buffer will be created using the given specified allocator and the value will be copied in.
/// FastBufferReader will then own the data.
///
- /// The exception to this is when the passed in is Allocator.None. In this scenario,
+ /// The exception to this is when the specified allocator passed in is Allocator.None. In this scenario,
/// ownership of the data remains with the caller and the reader will point at it directly.
/// When created with Allocator.None, FastBufferReader will allocate some internal data using
/// Allocator.Temp, so it should be treated as if it's a ref struct and not allowed to outlive
/// the context in which it was created (it should neither be returned from that function nor
- /// stored anywhere in heap memory). This is true, unless the param is explicitly set
+ /// stored anywhere in heap memory). This is true, unless the internal Allocator param is explicitly set
/// to i.e.: Allocator.Persistent in which case it would allow the internal data to Persist for longer, but the caller
/// should manually call Dispose() when it is no longer needed.
///
@@ -220,10 +220,10 @@ public unsafe FastBufferReader(FastBufferWriter writer, Allocator copyAllocator,
/// want to change the copyAllocator that a reader is allocated to - for example, upgrading a Temp reader to
/// a Persistent one to be processed later.
///
- /// A new buffer will be created using the given and the value will be copied in.
+ /// A new buffer will be created using the given specified allocator and the value will be copied in.
/// FastBufferReader will then own the data.
///
- /// The exception to this is when the passed in is Allocator.None. In this scenario,
+ /// The exception to this is when the specified allocator passed in is Allocator.None. In this scenario,
/// ownership of the data remains with the caller and the reader will point at it directly.
/// When created with Allocator.None, FastBufferReader will allocate some internal data using
/// Allocator.Temp, so it should be treated as if it's a ref struct and not allowed to outlive
@@ -435,9 +435,9 @@ public unsafe byte[] ToArray()
///
/// Read an INetworkSerializable
///
- ///
+ /// The type that implements INetworkSerializable and can be deserialized
/// INetworkSerializable instance
- ///
+ /// Thrown if the type T does not properly implement NetworkSerialize
public void ReadNetworkSerializable(out T value) where T : INetworkSerializable, new()
{
value = new T();
@@ -449,8 +449,8 @@ public unsafe byte[] ToArray()
/// Read an array of INetworkSerializables
///
/// INetworkSerializable instance
- /// the array to read the values of type `T` into
- ///
+ /// the array to read the values of type `T` from
+ /// Thrown if the type T does not properly implement NetworkSerialize
public void ReadNetworkSerializable(out T[] value) where T : INetworkSerializable, new()
{
ReadValueSafe(out int size);
@@ -466,8 +466,8 @@ public unsafe byte[] ToArray()
///
/// INetworkSerializable instance
/// The allocator to use to construct the resulting NativeArray
- /// the array to read the values of type `T` into
- ///
+ /// the array to read the values of type `T` from
+ /// Thrown if the type T does not properly implement NetworkSerialize
public void ReadNetworkSerializable(out NativeArray value, Allocator allocator) where T : unmanaged, INetworkSerializable
{
ReadValueSafe(out int size);
@@ -484,8 +484,8 @@ public void ReadNetworkSerializable(out NativeArray value, Allocator alloc
/// Read a NativeList of INetworkSerializables
///
/// INetworkSerializable instance
- /// the array to read the values of type `T` into
- ///
+ /// the array to read the values of type `T` from
+ /// Thrown if the type T does not properly implement NetworkSerialize
public void ReadNetworkSerializableInPlace(ref NativeList value) where T : unmanaged, INetworkSerializable
{
ReadValueSafe(out int size);
@@ -501,9 +501,9 @@ public void ReadNetworkSerializableInPlace(ref NativeList value) where T :
/// Read an INetworkSerializable in-place, without constructing a new one
/// Note that this will NOT check for null before calling NetworkSerialize
///
- ///
+ /// The type that implements INetworkSerializable and can be deserialized
/// INetworkSerializable instance
- ///
+ /// hrown if the type T does not properly implement NetworkSerialize
public void ReadNetworkSerializableInPlace(ref T value) where T : INetworkSerializable
{
var bufferSerializer = new BufferSerializer(new BufferSerializerReader(this));
@@ -591,11 +591,11 @@ public unsafe void ReadValueSafe(out string s, bool oneByteChars = false)
/// Read a partial value. The value is zero-initialized and then the specified number of bytes is read into it.
///
/// Value to read
- /// Number of bytes
- /// Offset into the value to write the bytes
- /// the type value to read the value into
- ///
- ///
+ /// The number of bytes to read from the buffer into the value
+ /// The offset in bytes from the start of the value where the read bytes will be written
+ /// The unmanaged type to read into. Must be unmanaged to allow direct memory access
+ /// Thrown when attempting to use BufferReader in bytewise mode while in a bitwise context
+ /// Thrown when attempting to read without first calling TryBeginRead() or when reading beyond the allowed read mark
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ReadPartialValue(out T value, int bytesToRead, int offsetBytes = 0) where T : unmanaged
{
@@ -1614,7 +1614,6 @@ public unsafe void ReadValueSafeInPlace(ref T value, FastBufferWriter.ForFixe
///
/// the value to read
/// The allocator to use to construct the resulting NativeArray
- /// An unused parameter used for enabling overload resolution based on generic constraints
/// The type being serialized
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ReadValueSafe(out NativeArray value, Allocator allocator)
@@ -1636,7 +1635,6 @@ public unsafe void ReadValueSafe(out NativeArray value, Allocator allocato
/// for multiple reads at once by calling TryBeginRead.
///
/// the value to read
- /// An unused parameter used for enabling overload resolution based on generic constraints
/// The type being serialized
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ReadValueSafeTemp(out NativeArray value)
@@ -1680,7 +1678,6 @@ public void ReadValueSafe(out T[] value, FastBufferWriter.ForFixedStrings unu
/// for multiple reads at once by calling TryBeginRead.
///
/// the value to read
- /// An unused parameter used for enabling overload resolution based on generic constraints
/// The type being serialized
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ReadValueSafeInPlace(ref NativeList value)
diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/FastBufferWriter.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/FastBufferWriter.cs
index 5fb5ca7be4..b22c0782e8 100644
--- a/com.unity.netcode.gameobjects/Runtime/Serialization/FastBufferWriter.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Serialization/FastBufferWriter.cs
@@ -8,9 +8,9 @@ namespace Unity.Netcode
{
///
/// Optimized class used for writing values into a byte stream
- ///
- ///
- ///
+ ///
+ ///
+ ///
///
public struct FastBufferWriter : IDisposable
{
@@ -314,9 +314,9 @@ public unsafe bool TryBeginWriteValue(in T value) where T : unmanaged
/// Internal version of TryBeginWrite.
/// Differs from TryBeginWrite only in that it won't ever move the AllowedWriteMark backward.
///
- ///
- ///
- ///
+ /// The number of bytes to check for write availability
+ /// True if the specified number of bytes can be written, false if there isn't enough space
+ /// Thrown when attempting to use BufferWriter in bytewise mode while in a bitwise context
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe bool TryBeginWriteInternal(int bytes)
{
@@ -356,7 +356,7 @@ public unsafe bool TryBeginWriteInternal(int bytes)
/// Returns an array representation of the underlying byte buffer.
/// !!Allocates a new array!!
///
- ///
+ /// A new byte array containing a copy of the buffer's contents.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe byte[] ToArray()
{
@@ -395,7 +395,7 @@ internal unsafe ArraySegment ToTempByteArray()
///
/// Gets a direct pointer to the underlying buffer
///
- ///
+ /// An unsafe pointer to the start of the underlying buffer memory
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe byte* GetUnsafePtr()
{
@@ -405,7 +405,7 @@ internal unsafe ArraySegment ToTempByteArray()
///
/// Gets a direct pointer to the underlying buffer at the current read position
///
- ///
+ /// An unsafe pointer to the underlying buffer memory offset by the current position
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe byte* GetUnsafePtrAtCurrentPosition()
{
@@ -417,7 +417,7 @@ internal unsafe ArraySegment ToTempByteArray()
///
/// The string to write
/// Whether or not to use one byte per character. This will only allow ASCII
- ///
+ /// The total number of bytes required to write the string, including the length field
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int GetWriteSize(string s, bool oneByteChars = false)
{
@@ -428,7 +428,7 @@ public static int GetWriteSize(string s, bool oneByteChars = false)
/// Write an INetworkSerializable
///
/// The value to write
- ///
+ /// The type of the value
public void WriteNetworkSerializable(in T value) where T : INetworkSerializable
{
var bufferSerializer = new BufferSerializer(new BufferSerializerWriter(this));
@@ -438,10 +438,10 @@ public void WriteNetworkSerializable(in T value) where T : INetworkSerializab
///
/// Write an array of INetworkSerializables
///
- /// The value to write
- ///
- ///
- ///
+ /// The array of objects to write
+ /// The number of elements to write. If set to -1, will write all elements from offset to end
+ /// The starting position in the array from which to begin writing
+ /// The type of the value
public void WriteNetworkSerializable(T[] array, int count = -1, int offset = 0) where T : INetworkSerializable
{
int sizeInTs = count != -1 ? count : array.Length - offset;
@@ -455,10 +455,10 @@ public void WriteNetworkSerializable(T[] array, int count = -1, int offset =
///
/// Write a NativeArray of INetworkSerializables
///
- /// The value to write
- ///
- ///
- ///
+ /// The NativeArray containing the values to write
+ /// The number of elements to write. If -1 (default), writes array.Length - offset elements
+ /// The starting position in the array. Defaults to 0
+ /// The type of the value
public void WriteNetworkSerializable(NativeArray array, int count = -1, int offset = 0) where T : unmanaged, INetworkSerializable
{
int sizeInTs = count != -1 ? count : array.Length - offset;
@@ -473,10 +473,10 @@ public void WriteNetworkSerializable(NativeArray array, int count = -1, in
///
/// Write a NativeList of INetworkSerializables
///
- /// The value to write
- ///
- ///
- ///
+ /// The NativeArray containing the values to write
+ /// The number of elements to write. If -1 (default), writes array.Length - offset elements
+ /// The starting position in the array. Defaults to 0/param>
+ /// The type of the value
public void WriteNetworkSerializable(NativeList array, int count = -1, int offset = 0) where T : unmanaged, INetworkSerializable
{
int sizeInTs = count != -1 ? count : array.Length - offset;
@@ -562,8 +562,8 @@ public unsafe void WriteValueSafe(string s, bool oneByteChars = false)
/// The array to write
/// The amount of elements to write
/// Where in the array to start
- ///
- ///
+ /// The type of elements in the array, must be unmanaged
+ /// The total number of bytes required to write the array, including the length field
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe int GetWriteSize(T[] array, int count = -1, int offset = 0) where T : unmanaged
{
@@ -578,8 +578,8 @@ public static unsafe int GetWriteSize(T[] array, int count = -1, int offset =
/// The array to write
/// The amount of elements to write
/// Where in the array to start
- ///
- ///
+ /// The type of elements in the array, must be unmanaged
+ /// The total number of bytes required to write the array, including the length field
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe int GetWriteSize(NativeArray array, int count = -1, int offset = 0) where T : unmanaged
{
@@ -595,8 +595,8 @@ public static unsafe int GetWriteSize(NativeArray array, int count = -1, i
/// The array to write
/// The amount of elements to write
/// Where in the array to start
- ///
- ///
+ /// The type of elements in the array, must be unmanaged
+ /// The total number of bytes required to write the array, including the length field
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe int GetWriteSize(NativeList array, int count = -1, int offset = 0) where T : unmanaged
{
@@ -612,9 +612,9 @@ public static unsafe int GetWriteSize(NativeList array, int count = -1, in
/// Value to write
/// Number of bytes
/// Offset into the value to begin reading the bytes
- ///
- ///
- ///
+ /// The type of elements in the array, must be unmanaged
+ /// Thrown when attempting to use BufferWriter in bytewise mode while in a bitwise context
+ /// Thrown when attempting to write without first calling TryBeginWrite() or when writing beyond the allowed write mark
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void WritePartialValue(T value, int bytesToWrite, int offsetBytes = 0) where T : unmanaged
{
@@ -857,10 +857,10 @@ public unsafe void CopyFrom(FastBufferWriter other)
/// The ForStructs value here makes this the lowest-priority overload so other versions
/// will be prioritized over this if they match
///
- ///
- ///
- ///
- ///
+ /// The unmanaged value to calculate the size for
+ /// Unused parameter for overload resolution
+ /// The type of the value, must be unmanaged
+ /// The size in bytes required to write the value
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe int GetWriteSize(in T value, ForStructs unused = default) where T : unmanaged
{
@@ -870,9 +870,9 @@ public static unsafe int GetWriteSize(in T value, ForStructs unused = default
///
/// Get the write size for a FixedString
///
- ///
- ///
- ///
+ /// The FixedString value to calculate the size for
+ /// The specific FixedString type, must implement INativeList{byte} and IUTF8Bytes
+ /// The size in bytes required to write the value
public static int GetWriteSize(in T value)
where T : unmanaged, INativeList, IUTF8Bytes
{
@@ -882,9 +882,9 @@ public static int GetWriteSize(in T value)
///
/// Get the write size for an array of FixedStrings
///
- ///
- ///
- ///
+ /// The NativeArray of FixedStrings to calculate the size for
+ /// The specific FixedString type, must implement INativeList{byte} and IUTF8Bytes
+ /// The total size in bytes required to write all strings, including all length fields
public static int GetWriteSize(in NativeArray value)
where T : unmanaged, INativeList, IUTF8Bytes
{
@@ -901,9 +901,9 @@ public static int GetWriteSize(in NativeArray value)
///
/// Get the write size for an array of FixedStrings
///
- ///
- ///
- ///
+ /// The NativeList of FixedStrings to calculate the size for
+ /// The specific FixedString type, must implement INativeList{byte} and IUTF8Bytes
+ /// The total size in bytes required to write all strings, including all length fields
public static int GetWriteSize(in NativeList value)
where T : unmanaged, INativeList, IUTF8Bytes
{
@@ -920,8 +920,8 @@ public static int GetWriteSize(in NativeList value)
///
/// Get the size required to write an unmanaged value of type T
///
- ///
- ///
+ /// The type to calculate the size for, must be unmanaged
+ /// The size in bytes required to write a value of type T
public static unsafe int GetWriteSize() where T : unmanaged
{
return sizeof(T);
@@ -1885,7 +1885,6 @@ public void WriteValueSafe(T[] value, ForFixedStrings unused = default)
/// for multiple writes at once by calling TryBeginWrite.
///
/// the value to write
- /// An unused parameter used for enabling overload resolution based on generic constraints
/// The type being serialized
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void WriteValueSafe(in NativeArray value)
@@ -1909,7 +1908,6 @@ public void WriteValueSafe(in NativeArray value)
/// for multiple writes at once by calling TryBeginWrite.
///
/// the value to write
- /// An unused parameter used for enabling overload resolution based on generic constraints
/// The type being serialized
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void WriteValueSafe(in NativeList value)
diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/ForceNetworkSerializeByMemcpy.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/ForceNetworkSerializeByMemcpy.cs
index 64cdf755a5..7282db3601 100644
--- a/com.unity.netcode.gameobjects/Runtime/Serialization/ForceNetworkSerializeByMemcpy.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Serialization/ForceNetworkSerializeByMemcpy.cs
@@ -6,7 +6,7 @@ namespace Unity.Netcode
/// This is a wrapper that adds `INetworkSerializeByMemcpy` support to existing structs that the developer
/// doesn't have the ability to modify (for example, external structs like `Guid`).
///
- ///
+ /// The type to be wrapped, must be unmanaged and implement IEquatable{T}
public struct ForceNetworkSerializeByMemcpy : INetworkSerializeByMemcpy, IEquatable> where T : unmanaged, IEquatable
{
///
diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/IReaderWriter.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/IReaderWriter.cs
index bdddec4924..2ec4f7b95d 100644
--- a/com.unity.netcode.gameobjects/Runtime/Serialization/IReaderWriter.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Serialization/IReaderWriter.cs
@@ -145,7 +145,6 @@ void SerializeValue(ref T value, FastBufferWriter.ForFixedStrings unused = de
///
/// The value to read/write
/// The allocator to use to construct the resulting NativeArray when reading
- /// An unused parameter used for enabling overload resolution based on generic constraints
/// The type being serialized
void SerializeValue(ref NativeArray value, Allocator allocator)
where T : unmanaged, INativeList, IUTF8Bytes;
@@ -155,7 +154,6 @@ void SerializeValue(ref NativeArray value, Allocator allocator)
/// Read or write a NativeList of FixedString values
///
/// The value to read/write
- /// An unused parameter used for enabling overload resolution based on generic constraints
/// The type being serialized
void SerializeValue(ref NativeList value)
where T : unmanaged, INativeList, IUTF8Bytes;
@@ -295,8 +293,11 @@ void SerializeValue(ref NativeList value)
/// SerializeValuePreChecked methods. But note that the benefit is small and only likely to be
/// noticeable if serializing a very large number of items.
///
- ///
- ///
+ /// The number of bytes to check for availability in the buffer
+ ///
+ /// True if there is sufficient space for the specified amount of bytes.
+ /// False if there isn't enough space available.
+ ///
bool PreCheck(int amount);
///
diff --git a/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkBehaviourReference.cs b/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkBehaviourReference.cs
index 70c4b5e87a..69299deed6 100644
--- a/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkBehaviourReference.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Serialization/NetworkBehaviourReference.cs
@@ -19,7 +19,7 @@ public struct NetworkBehaviourReference : INetworkSerializable, IEquatable struct.
///
/// The to reference.
- ///
+ /// Thrown when the provided NetworkBehaviour does not have an associated NetworkObject. This can happen if the behaviour is not properly attached to a networked GameObject.
public NetworkBehaviourReference(NetworkBehaviour networkBehaviour)
{
if (networkBehaviour == null)
diff --git a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkPrefabHandler.cs b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkPrefabHandler.cs
index bb0afc4f3a..fe0dd270e9 100644
--- a/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkPrefabHandler.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkPrefabHandler.cs
@@ -24,7 +24,7 @@ public interface INetworkPrefabInstanceHandler
/// the owner for the to be instantiated
/// the initial/default position for the to be instantiated
/// the initial/default rotation for the to be instantiated
- ///
+ /// The instantiated NetworkObject instance. Returns null if instantiation fails.
NetworkObject Instantiate(ulong ownerClientId, Vector3 position, Quaternion rotation);
///
@@ -81,7 +81,7 @@ public bool AddHandler(GameObject networkPrefabAsset, INetworkPrefabInstanceHand
///
/// the of the network prefab asset to be overridden
/// the class that implements the interface to be registered
- ///
+ /// true (registered) false (failed to register)
public bool AddHandler(NetworkObject prefabAssetNetworkObject, INetworkPrefabInstanceHandler instanceHandler)
{
return AddHandler(prefabAssetNetworkObject.GlobalObjectIdHash, instanceHandler);
@@ -92,7 +92,7 @@ public bool AddHandler(NetworkObject prefabAssetNetworkObject, INetworkPrefabIns
///
/// the value of the network prefab asset being overridden
/// a class that implements the interface
- ///
+ /// true (registered) false (failed to register)
public bool AddHandler(uint globalObjectIdHash, INetworkPrefabInstanceHandler instanceHandler)
{
if (!m_PrefabAssetToPrefabHandler.ContainsKey(globalObjectIdHash))
@@ -343,8 +343,8 @@ public GameObject GetNetworkPrefabOverride(GameObject gameObject)
/// should not be relied on and code shouldn't be written around it - your code should be written so that
/// the asset is expected to be loaded before it's needed.
///
- ///
- ///
+ /// The GameObject with NetworkObject component to add as a network prefab
+ /// Thrown when adding prefabs after startup with ForceSamePrefabs is enabled or prefab doesn't have a NetworkObject component
public void AddNetworkPrefab(GameObject prefab)
{
if (m_NetworkManager.IsListening && m_NetworkManager.NetworkConfig.ForceSamePrefabs)
@@ -375,7 +375,8 @@ public void AddNetworkPrefab(GameObject prefab)
/// Like AddNetworkPrefab, when NetworkConfig.ForceSamePrefabs is enabled,
/// this cannot be called after connecting.
///
- ///
+ /// The GameObject to remove from the network prefab list
+ /// Thrown when attempting to remove prefabs after startup with ForceSamePrefabs enabled
public void RemoveNetworkPrefab(GameObject prefab)
{
if (m_NetworkManager.IsListening && m_NetworkManager.NetworkConfig.ForceSamePrefabs)
diff --git a/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTime.cs b/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTime.cs
index 7c624c48fb..916a35e6c4 100644
--- a/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTime.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTime.cs
@@ -114,13 +114,14 @@ public NetworkTime ToFixedTime()
}
///
- /// Returns the time a number of ticks in the past.
+ /// Calculates a NetworkTime value representing a point in the past relative to the current time (few ticks in the past)
///
- /// The number of ticks ago we're querying the time
- ///
- public NetworkTime TimeTicksAgo(int ticks)
+ /// The number of ticks ago we're querying the time.
+ /// Optional parameter to specify a tick offset (fractional) value.
+ /// A NetworkTime value representing the calculated past time point
+ public NetworkTime TimeTicksAgo(int ticks, float offset = 0.0f)
{
- return this - new NetworkTime(TickRate, ticks);
+ return this - new NetworkTime(TickRate, ticks, offset);
}
private void UpdateCache()
diff --git a/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTimeSystem.cs b/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTimeSystem.cs
index 41327dbcd2..a40c88ed0a 100644
--- a/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTimeSystem.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Timing/NetworkTimeSystem.cs
@@ -200,7 +200,7 @@ public static NetworkTimeSystem ServerTimeSystem()
/// Advances the time system by a certain amount of time. Should be called once per frame with Time.unscaledDeltaTime or similar.
///
/// The amount of time to advance. The delta time which passed since Advance was last called.
- ///
+ /// True if a hard reset of the time system occurred due to large time offset differences. False if normal time advancement occurred
public bool Advance(double deltaTimeSec)
{
m_TimeSec += deltaTimeSec;
diff --git a/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs b/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs
index 9de70aff65..7127279cda 100644
--- a/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs
+++ b/com.unity.netcode.gameobjects/Runtime/Transports/NetworkTransport.cs
@@ -6,7 +6,7 @@ namespace Unity.Netcode
///
/// The generic transport class all Netcode for GameObjects network transport implementations
/// derive from. Use this class to add a custom transport.
- /// for an example of how a transport is integrated
+ /// for an example of how a transport is integrated
///
public abstract class NetworkTransport : MonoBehaviour
{
@@ -104,7 +104,7 @@ protected void InvokeOnTransportEvent(NetworkEvent eventType, ulong clientId, Ar
///
/// Initializes the transport
///
- /// /// optionally pass in NetworkManager
+ /// optionally pass in NetworkManager
public abstract void Initialize(NetworkManager networkManager = null);
}
diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs
index 0de0ca2001..3669c36f16 100644
--- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs
+++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTestHelpers.cs
@@ -267,7 +267,8 @@ internal static NetworkManager CreateNewClient(int identifier, bool mockTranspor
/// Used to add a client to the already existing list of clients
///
/// The amount of clients
- ///
+ /// Output array containing the newly created NetworkManager instances.
+ /// If true, uses mock transport for testing. Defaults to false.
public static bool CreateNewClients(int clientCount, out NetworkManager[] clients, bool useMockTransport = false)
{
clients = new NetworkManager[clientCount];
@@ -284,7 +285,8 @@ public static bool CreateNewClients(int clientCount, out NetworkManager[] client
///
/// Stops one single client and makes sure to cleanup any static variables in this helper
///
- ///
+ /// The NetworkManager instance to stop. Must not be null.
+ /// If true, destroys the GameObject and removes from NetworkManagerInstances. Defaults to true.
public static void StopOneClient(NetworkManager clientToStop, bool destroy = true)
{
clientToStop.Shutdown();
@@ -299,7 +301,7 @@ public static void StopOneClient(NetworkManager clientToStop, bool destroy = tru
///
/// Starts one single client and makes sure to register the required hooks and handlers
///
- ///
+ /// The NetworkManager instance to start. Must not be null.
public static void StartOneClient(NetworkManager clientToStart)
{
clientToStart.StartClient();
@@ -605,7 +607,7 @@ public static void MarkAsSceneObjectRoot(GameObject networkObjectRoot, NetworkMa
///
/// The client
/// The result. If null, it will automatically assert
- /// The max frames to wait for
+ /// Maximum time in seconds to wait for the object to be found.
public static IEnumerator WaitForClientConnected(NetworkManager client, ResultWrapper result = null, float timeout = DefaultTimeout)
{
yield return WaitForClientsConnected(new NetworkManager[] { client }, result, timeout);
@@ -616,7 +618,7 @@ public static IEnumerator WaitForClientConnected(NetworkManager client, ResultWr
///
/// The clients to be connected
/// The result. If null, it will automatically assert<
- /// The max frames to wait for
+ /// Maximum time in seconds to wait for the object to be found.
///
public static IEnumerator WaitForClientsConnected(NetworkManager[] clients, ResultWrapper result = null, float timeout = DefaultTimeout)
{
@@ -672,7 +674,7 @@ public static IEnumerator WaitForClientsConnected(NetworkManager[] clients, Resu
///
/// The server
/// The result. If null, it will automatically assert
- /// The max frames to wait for
+ /// Maximum time in seconds to wait for the object to be found.
public static IEnumerator WaitForClientConnectedToServer(NetworkManager server, ResultWrapper result = null, float timeout = DefaultTimeout)
{
yield return WaitForClientsConnectedToServer(server, server.IsHost ? s_ClientCount + 1 : s_ClientCount, result, timeout);
@@ -683,7 +685,7 @@ public static IEnumerator WaitForClientConnectedToServer(NetworkManager server,
///
/// The server
/// The result. If null, it will automatically assert
- /// The max frames to wait for
+ /// Maximum time in seconds to wait for the object to be found.
public static IEnumerator WaitForClientsConnectedToServer(NetworkManager server, int clientCount = 1, ResultWrapper result = null, float timeout = DefaultTimeout)
{
if (!server.IsServer)
@@ -718,7 +720,7 @@ public static IEnumerator WaitForClientsConnectedToServer(NetworkManager server,
/// The representation to get the object from
/// The result
/// Whether or not to fail if no object is found and result is null
- /// The max frames to wait for
+ /// Maximum time in seconds to wait for the object to be found.
public static IEnumerator GetNetworkObjectByRepresentation(ulong networkObjectId, NetworkManager representation, ResultWrapper result, bool failIfNull = true, float timeout = DefaultTimeout)
{
if (result == null)
@@ -749,7 +751,7 @@ public static IEnumerator GetNetworkObjectByRepresentation(ulong networkObjectId
/// The representation to get the object from
/// The result
/// Whether or not to fail if no object is found and result is null
- /// The max frames to wait for
+ /// Maximum time in seconds to wait for the object to be found.
public static IEnumerator GetNetworkObjectByRepresentation(Func predicate, NetworkManager representation, ResultWrapper result, bool failIfNull = true, float timeout = DefaultTimeout)
{
if (result == null)
@@ -785,7 +787,7 @@ public static IEnumerator GetNetworkObjectByRepresentation(FuncThe representation to get the object from
/// The result
/// Whether or not to fail if no object is found and result is null
- /// The max frames to wait for
+ /// The max frames to wait for
public static void GetNetworkObjectByRepresentationWithTimeTravel(Func predicate, NetworkManager representation, ResultWrapper result, bool failIfNull = true, int maxTries = 60)
{
if (result == null)
@@ -818,7 +820,7 @@ public static void GetNetworkObjectByRepresentationWithTimeTravel(FuncThe predicate to wait for
/// The result. If null, it will fail if the predicate is not met
/// The min frames to wait for
- /// The max frames to wait for
+ /// Maximum time in seconds to wait for the object to be found.
public static IEnumerator WaitForCondition(Func predicate, ResultWrapper result = null, float timeout = DefaultTimeout, int minFrames = DefaultMinFrames)
{
if (predicate == null)
@@ -858,7 +860,7 @@ public static IEnumerator WaitForCondition(Func predicate, ResultWrapper
/// The result. If null, it will fail if the predicate is not met
- /// The max time in seconds to wait for
+ /// Maximum time in seconds to wait for the object to be found.
internal static IEnumerator WaitForMessageOfTypeReceived(NetworkManager toBeReceivedBy, ResultWrapper result = null, float timeout = DefaultTimeout) where T : INetworkMessage
{
var hooks = s_Hooks[toBeReceivedBy];
@@ -886,7 +888,7 @@ internal static IEnumerator WaitForMessageOfTypeReceived(NetworkManager toBeR
/// Waits for a message of the given type to be received
///
/// The result. If null, it will fail if the predicate is not met
- /// The max time in seconds to wait for
+ /// Maximum time in seconds to wait for the object to be found.
internal static IEnumerator WaitForMessageOfTypeHandled(NetworkManager toBeReceivedBy, ResultWrapper result = null, float timeout = DefaultTimeout) where T : INetworkMessage
{
var hooks = s_Hooks[toBeReceivedBy];
@@ -910,7 +912,7 @@ internal static IEnumerator WaitForMessageOfTypeHandled(NetworkManager toBeRe
///
/// Called for each received message to check if it's the right one
/// The result. If null, it will fail if the predicate is not met
- /// The max time in seconds to wait for
+ /// Maximum time in seconds to wait for the object to be found.
internal static IEnumerator WaitForMessageMeetingRequirementHandled(NetworkManager toBeReceivedBy, MessageHandleCheck requirement, ResultWrapper result = null, float timeout = DefaultTimeout)
{
var hooks = s_Hooks[toBeReceivedBy];
diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetworkManagerHelper.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetworkManagerHelper.cs
index 23aad063dc..03d1d807b9 100644
--- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetworkManagerHelper.cs
+++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetworkManagerHelper.cs
@@ -93,7 +93,7 @@ public static bool StartNetworkManager(out NetworkManager networkManager, Networ
/// Add a GameObject with a NetworkObject component
///
/// the name of the object
- ///
+ /// A unique identifier (GUID) for the newly created GameObject
public static Guid AddGameNetworkObject(string nameOfGameObject)
{
var gameObjectId = Guid.NewGuid();
@@ -121,7 +121,7 @@ public static Guid AddGameNetworkObject(string nameOfGameObject)
///
/// NetworkBehaviour component being added to the GameObject
/// ID returned to reference the game object
- ///
+ /// The newly added component instance of type T
public static T AddComponentToObject(Guid gameObjectIdentifier) where T : NetworkBehaviour
{
Assert.IsTrue(InstantiatedGameObjects.ContainsKey(gameObjectIdentifier));
diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetworkVariableHelper.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetworkVariableHelper.cs
index 343e0bb788..c4ea54eaf2 100644
--- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetworkVariableHelper.cs
+++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/NetworkVariableHelper.cs
@@ -8,11 +8,11 @@ namespace Unity.Netcode.TestHelpers.Runtime
/// delegate handler. It then will expose that single delegate invocation
/// to anything that registers for this NetworkVariableHelper's instance's OnValueChanged event.
/// This allows us to register any NetworkVariable type as well as there are basically two "types of types":
- /// IEquatable
+ /// IEquatable{T}
/// ValueType
/// From both we can then at least determine if the value indeed changed
///
- ///
+ /// The type of value managed by the NetworkVariable
public class NetworkVariableHelper : NetworkVariableBaseHelper
{
private readonly NetworkVariable m_NetworkVariable;
diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/TimeoutHelper.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/TimeoutHelper.cs
index 1de7802444..a101873e6c 100644
--- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/TimeoutHelper.cs
+++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/TimeoutHelper.cs
@@ -3,7 +3,7 @@
namespace Unity.Netcode.TestHelpers.Runtime
{
///
- /// Can be used independently or assigned to in the
+ /// Can be used independently or assigned to in the
/// event the default timeout period needs to be adjusted
///
public class TimeoutHelper
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkBehaviourUpdaterTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkBehaviourUpdaterTests.cs
index 90e0be75c0..17aa441c15 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkBehaviourUpdaterTests.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkBehaviourUpdaterTests.cs
@@ -17,7 +17,7 @@ public class NetVarContainer : NetworkBehaviour
///
/// Creates a prefab with two instances of this NetworkBehaviour
///
- ///
+ /// The created prefab
public static GameObject CreatePrefabGameObject(NetVarCombinationTypes netVarsToCheck)
{
var gameObject = new GameObject
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectDestroyTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectDestroyTests.cs
index 0e6d20e23f..49f8566fc5 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectDestroyTests.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectDestroyTests.cs
@@ -20,7 +20,7 @@ public class NetworkObjectDestroyTests : NetcodeIntegrationTest
///
/// Tests that a server can destroy a NetworkObject and that it gets despawned correctly.
///
- ///
+ /// An IEnumerator for the UnityTest coroutine that validates object destruction and cleanup.
[UnityTest]
public IEnumerator TestNetworkObjectServerDestroy()
{
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectOnSpawnTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectOnSpawnTests.cs
index 17b618a0a1..10da7f8437 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectOnSpawnTests.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectOnSpawnTests.cs
@@ -229,7 +229,7 @@ protected override IEnumerator OnTearDown()
///
/// Test that callbacks are run for playerobject spawn, despawn, regular spawn, destroy on server.
///
- ///
+ /// An IEnumerator for the UnityTest coroutine that validates callback execution.
[UnityTest]
public IEnumerator TestOnNetworkSpawnCallbacks()
{
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectPropertyTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectPropertyTests.cs
index 364a7cf05d..95f584c92d 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectPropertyTests.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectPropertyTests.cs
@@ -35,7 +35,6 @@ public void TestPrefabHashIdPropertyNotAPrefab()
///
/// Tests PrefabHashId returns correctly when the NetworkObject is a prefab.
///
- ///
[Test]
public void TestPrefabHashIdPropertyIsAPrefab()
{
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformBase.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformBase.cs
index 95ef88a784..6c97328ab2 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformBase.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformBase.cs
@@ -12,7 +12,7 @@ namespace Unity.Netcode.RuntimeTests
public class NetworkTransformBase : IntegrationTestWithApproximation
{
- // The number of iterations to change position, rotation, and scale for NetworkTransformMultipleChangesOverTime
+ // The number of iterations to change position, rotation, and scale for NetworkTransformMultipleChangesOverTime
protected const int k_PositionRotationScaleIterations = 3;
protected const int k_PositionRotationScaleIterations3Axis = 8;
@@ -132,7 +132,7 @@ protected override float GetDeltaVarianceThreshold()
///
/// Override to provide the number of clients
///
- ///
+ /// The number of clients to create. Default implementation returns 1.
protected virtual int OnNumberOfClients()
{
return 1;
@@ -353,7 +353,10 @@ protected override void OnNewClientCreated(NetworkManager networkManager)
/// Returns true when the server-host and all clients have
/// instantiated the child object to be used in
///
- ///
+ ///
+ /// Returns true if The authority instance exists OR The sub-child instance exists (if HasSubChild is true) OR All clients have received their instances.
+ /// Returns false if any of these conditions are not met.
+ ///
protected bool AllChildObjectInstancesAreSpawned()
{
if (ChildObjectComponent.AuthorityInstance == null)
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformPacketLossTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformPacketLossTests.cs
index d382cfb483..f231bce89d 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformPacketLossTests.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformPacketLossTests.cs
@@ -192,7 +192,7 @@ public void ParentedNetworkTransformTest([Values] Interpolation interpolation, [
/// several ticks while still keeping non-authoritative instances synchronized.
///
///
- /// When testing < 3 axis: Interpolation is disabled and only 3 delta updates are applied per unique test
+ /// When testing 3 axis: Interpolation is disabled and only 3 delta updates are applied per unique test
/// When testing 3 axis: Interpolation is enabled, sometimes an axis is intentionally excluded during a
/// delta update, and it runs through 8 delta updates per unique test.
///
@@ -478,7 +478,7 @@ private void OnAuthorityPushedTransformState(ref NetworkTransform.NetworkTransfo
// Match the first position update
if (Approximately(m_RandomPosition, networkTransformState.GetPosition()))
{
- // Teleport to the m_RandomPosition plus the
+ // Teleport to the m_RandomPosition plus the
m_AuthoritativeTransform.SetState(m_TeleportOffset + m_RandomPosition, null, null, false);
m_AuthoritativeTransform.AuthorityPushedTransformState -= OnAuthorityPushedTransformState;
m_Teleported = true;
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformTests.cs
index bf72bba38e..e68b64f105 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformTests.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformTests.cs
@@ -197,7 +197,7 @@ public void ParentedNetworkTransformTest([Values] Interpolation interpolation, [
/// several ticks while still keeping non-authoritative instances synchronized.
///
///
- /// When testing < 3 axis: Interpolation is disabled and only 3 delta updates are applied per unique test
+ /// When testing 3 axis: Interpolation is disabled and only 3 delta updates are applied per unique test
/// When testing 3 axis: Interpolation is enabled, sometimes an axis is intentionally excluded during a
/// delta update, and it runs through 8 delta updates per unique test.
///
@@ -294,7 +294,7 @@ public void NetworkTransformMultipleChangesOverTime([Values] TransformSpace test
Assert.True(WaitForConditionOrTimeOutWithTimeTravel(() => m_AuthoritativeTransform.StatePushed && m_NonAuthoritativeTransform.StateUpdated), $"[Non-Interpolate {i}] Timed out waiting for state to be pushed ({m_AuthoritativeTransform.StatePushed}) or state to be updated ({m_NonAuthoritativeTransform.StateUpdated})!");
// For 3 axis, we will skip validating that the non-authority interpolates to its target point at least once.
- // This will validate that non-authoritative updates are maintaining their target state axis values if only 2
+ // This will validate that non-authoritative updates are maintaining their target state axis values if only 2
// of the axis are being updated to assure interpolation maintains the targeted axial value per axis.
// For 2 and 1 axis tests we always validate per delta update
if (m_AxisExcluded || axisCount < 3)
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs
index 1d17fcccdb..2a9a1b052e 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableBaseInitializesWhenPersisted.cs
@@ -249,7 +249,7 @@ public static void OneTimeSetup(int numberOfInstances, GameObject prefabInstance
///
/// Invoke when s are created but not started.
///
- ///
+ /// The NetworkManager instance to assign a handler to. Must not be null and must not already have a handler assigned.
public static void AssignHandler(NetworkManager networkManager)
{
if (s_PrefabInstanceHandlers.Count > 0)
@@ -273,7 +273,12 @@ public static NetworkObject GetInstanceToSpawn(NetworkManager networkManager)
return null;
}
-
+ ///
+ /// Validates that a NetworkManager has the minimum required number of persisted instances.
+ ///
+ /// The NetworkManager instance to validate. Must not be null.
+ /// The minimum number of instances that should exist. Must be greater than or equal to zero.
+ /// True if the NetworkManager has at least the minimum required instances, false otherwise or if the NetworkManager is not registered.
public static bool ValidatePersistedInstances(NetworkManager networkManager, int minCount)
{
if (s_AssignedInstances.ContainsKey(networkManager))
@@ -286,9 +291,9 @@ public static bool ValidatePersistedInstances(NetworkManager networkManager, int
///
/// Releases back to the queue and if destroy is true it will completely
- /// remove all references so they are cleaned up when
+ /// remove all references so they are cleaned up when
///
- ///
+ /// If true, completely removes all references and cleans up instances. If false, returns handlers to the queue for reuse.
public static void ReleaseAll(bool destroy = false)
{
foreach (var entry in s_AssignedInstances)
diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs
index 047435fa26..2e6279999c 100644
--- a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs
+++ b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/NetworkTimeSystemTests.cs
@@ -30,7 +30,7 @@ public void Setup()
/// Tests whether time is accessible and has correct values inside Update/FixedUpdate.
/// This test applies only when is 1.
///
- ///
+ /// An IEnumerator for the UnityTest coroutine that validates time values in the player loop.
[UnityTest]
public IEnumerator PlayerLoopFixedTimeTest()
{
@@ -42,7 +42,7 @@ public IEnumerator PlayerLoopFixedTimeTest()
///
/// Tests whether time is accessible and has correct values inside Update, for multiples values.
///
- ///
+ /// An IEnumerator for the UnityTest coroutine that validates time values under different time scales.
[UnityTest]
public IEnumerator PlayerLoopTimeTest_WithDifferentTimeScale([Values(0.0f, 0.1f, 0.5f, 1.0f, 2.0f, 5.0f)] float timeScale)
{
@@ -57,7 +57,7 @@ public IEnumerator PlayerLoopTimeTest_WithDifferentTimeScale([Values(0.0f, 0.1f,
/// Tests whether the time system invokes the correct amount of ticks over a period of time.
/// Note we cannot test against Time.Time directly because of floating point precision. Our time is more precise leading to different results.
///
- ///
+ /// An IEnumerator for the UnityTest coroutine.
[UnityTest]
public IEnumerator CorrectAmountTicksTest()
{
diff --git a/com.unity.netcode.gameobjects/pvpExceptions.json b/com.unity.netcode.gameobjects/pvpExceptions.json
deleted file mode 100644
index 988e4d7a6d..0000000000
--- a/com.unity.netcode.gameobjects/pvpExceptions.json
+++ /dev/null
@@ -1,1073 +0,0 @@
-{
- "exempts": {
- "PVP-41-1": {
- "errors": [
- "CHANGELOG.md: line 9: Unreleased section is not allowed for public release"
- ]
- },
- "PVP-150-1": {
- "errors": [
- "Unity.Netcode.Components.AnticipatedNetworkTransform: in list item context (only allowed in block or inline context)",
- "Unity.Netcode.Components.AnticipatedNetworkTransform: in list item context (only allowed in block or inline context)",
- "Unity.Netcode.Components.AnticipatedNetworkTransform: void AnticipateMove(Vector3): empty tag",
- "Unity.Netcode.Components.AnticipatedNetworkTransform: void AnticipateRotate(Quaternion): empty tag",
- "Unity.Netcode.Components.AnticipatedNetworkTransform: void AnticipateScale(Vector3): empty tag",
- "Unity.Netcode.Components.AnticipatedNetworkTransform: void AnticipateState(TransformState): empty tag",
- "Unity.Netcode.Components.AnticipatedNetworkTransform: void Smooth(TransformState, TransformState, float): empty tag",
- "Unity.Netcode.AnticipatedNetworkVariable: in list item context (only allowed in block or inline context)",
- "Unity.Netcode.AnticipatedNetworkVariable: in list item context (only allowed in block or inline context)",
- "Unity.Netcode.AnticipatedNetworkVariable: void Anticipate(T): empty tag",
- "Unity.Netcode.AnticipatedNetworkVariable: void Smooth(in T, in T, float, AnticipatedNetworkVariable.SmoothDelegate): empty tag",
- "Unity.Netcode.BufferedLinearInterpolatorVector3: XML is not well-formed: Missing closing quotation mark for string literal",
- "Unity.Netcode.BufferSerializer: void SerializeValue(ref NativeArray, Allocator): unexpected ",
- "Unity.Netcode.BufferSerializer: bool PreCheck(int): empty tag",
- "Unity.Netcode.BufferSerializer: bool PreCheck(int): empty tag",
- "Unity.Netcode.BytePacker: in block context; use instead",
- "Unity.Netcode.ByteUnpacker: in block context; use instead",
- "Unity.Netcode.ByteUnpacker: void ReadValuePacked(FastBufferReader, out string): empty tag",
- "Unity.Netcode.FastBufferReader: in block context; use instead",
- "Unity.Netcode.FastBufferReader: .ctor(NativeArray, Allocator, int, int, Allocator): in block context (only allowed in top-level context)",
- "Unity.Netcode.FastBufferReader: .ctor(NativeArray, Allocator, int, int, Allocator): empty tag",
- "Unity.Netcode.FastBufferReader: .ctor(byte*, Allocator, int, int, Allocator): in block context (only allowed in top-level context)",
- "Unity.Netcode.FastBufferReader: .ctor(byte*, Allocator, int, int, Allocator): empty tag",
- "Unity.Netcode.FastBufferReader: .ctor(FastBufferWriter, Allocator, int, int, Allocator): in block context (only allowed in top-level context)",
- "Unity.Netcode.FastBufferReader: .ctor(FastBufferWriter, Allocator, int, int, Allocator): empty tag",
- "Unity.Netcode.FastBufferReader: .ctor(FastBufferReader, Allocator, int, int, Allocator): in block context (only allowed in top-level context)",
- "Unity.Netcode.FastBufferReader: .ctor(FastBufferReader, Allocator, int, int, Allocator): empty tag",
- "Unity.Netcode.FastBufferReader: void ReadNetworkSerializable(out T): empty tag",
- "Unity.Netcode.FastBufferReader: void ReadNetworkSerializable(out T): empty tag",
- "Unity.Netcode.FastBufferReader: void ReadNetworkSerializable(out T[]): empty tag",
- "Unity.Netcode.FastBufferReader: void ReadNetworkSerializable(out NativeArray, Allocator): empty tag",
- "Unity.Netcode.FastBufferReader: void ReadNetworkSerializableInPlace(ref T): empty tag",
- "Unity.Netcode.FastBufferReader: void ReadNetworkSerializableInPlace(ref T): empty tag",
- "Unity.Netcode.FastBufferReader: void ReadPartialValue(out T, int, int): empty tag",
- "Unity.Netcode.FastBufferReader: void ReadValueSafe(out NativeArray, Allocator): unexpected ",
- "Unity.Netcode.FastBufferReader: void ReadValueSafeTemp(out NativeArray): unexpected ",
- "Unity.Netcode.FastBufferWriter: in block context; use instead",
- "Unity.Netcode.FastBufferWriter: bool TryBeginWriteInternal(int): empty tag",
- "Unity.Netcode.FastBufferWriter: bool TryBeginWriteInternal(int): empty tag",
- "Unity.Netcode.FastBufferWriter: bool TryBeginWriteInternal(int): empty tag",
- "Unity.Netcode.FastBufferWriter: byte[] ToArray(): empty tag",
- "Unity.Netcode.FastBufferWriter: byte* GetUnsafePtr(): empty tag",
- "Unity.Netcode.FastBufferWriter: byte* GetUnsafePtrAtCurrentPosition(): empty tag",
- "Unity.Netcode.FastBufferWriter: int GetWriteSize(string, bool): empty tag",
- "Unity.Netcode.FastBufferWriter: void WriteNetworkSerializable(in T): empty tag",
- "Unity.Netcode.FastBufferWriter: void WriteNetworkSerializable(T[], int, int): empty tag",
- "Unity.Netcode.FastBufferWriter: void WriteNetworkSerializable(T[], int, int): empty tag",
- "Unity.Netcode.FastBufferWriter: void WriteNetworkSerializable(NativeArray, int, int): empty tag",
- "Unity.Netcode.FastBufferWriter: void WriteNetworkSerializable(NativeArray, int, int): empty tag",
- "Unity.Netcode.FastBufferWriter: int GetWriteSize(T[], int, int): empty tag",
- "Unity.Netcode.FastBufferWriter: int GetWriteSize(T[], int, int): empty tag",
- "Unity.Netcode.FastBufferWriter: int GetWriteSize(NativeArray, int, int): empty tag",
- "Unity.Netcode.FastBufferWriter: int GetWriteSize(NativeArray, int, int): empty tag",
- "Unity.Netcode.FastBufferWriter: void WritePartialValue(T, int, int): empty tag",
- "Unity.Netcode.FastBufferWriter: void WritePartialValue(T, int, int): empty tag",
- "Unity.Netcode.FastBufferWriter: int GetWriteSize(in T, ForStructs): empty