Skip to content

Commit b008929

Browse files
authored
fix: API doc fixes from user feedback (#2878)
* Adding missing words for OnDestroy API doc * Reference pointing to what? * Improving remarks for OnServerStopped and OnClientStopped * Updates to summary from review * Formatting
1 parent 76e6cb0 commit b008929

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ internal void InternalOnGainedOwnership()
681681
/// <summary>
682682
/// Invoked on all clients, override this method to be notified of any
683683
/// ownership changes (even if the instance was niether the previous or
684-
/// newly assigned current owner).
684+
/// newly assigned current owner).
685685
/// </summary>
686686
/// <param name="previous">the previous owner</param>
687687
/// <param name="current">the current owner</param>
@@ -1223,9 +1223,9 @@ internal bool Synchronize<T>(ref BufferSerializer<T> serializer, ulong targetCli
12231223

12241224

12251225
/// <summary>
1226-
/// Invoked when the <see cref="GameObject"/> the <see cref="NetworkBehaviour"/> is attached to.
1227-
/// NOTE: If you override this, you will want to always invoke this base class version of this
1228-
/// <see cref="OnDestroy"/> method!!
1226+
/// Invoked when the <see cref="GameObject"/> the <see cref="NetworkBehaviour"/> is attached to is destroyed.
1227+
/// NOTE: If you override this, you should invoke this base class version of this
1228+
/// <see cref="OnDestroy"/> method.
12291229
/// </summary>
12301230
public virtual void OnDestroy()
12311231
{

com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,20 +463,21 @@ public struct ConnectionApprovalRequest
463463
public event Action OnServerStarted = null;
464464

465465
/// <summary>
466-
/// The callback to invoke once the local client is ready
466+
/// The callback to invoke once the local client is ready.
467467
/// </summary>
468468
public event Action OnClientStarted = null;
469469

470470
/// <summary>
471471
/// This callback is invoked once the local server is stopped.
472472
/// </summary>
473+
/// <remarks>The bool parameter will be set to true when stopping a host instance and false when stopping a server instance.</remarks>
473474
/// <param name="arg1">The first parameter of this event will be set to <see cref="true"/> when stopping a host instance and <see cref="false"/> when stopping a server instance.</param>
474475
public event Action<bool> OnServerStopped = null;
475476

476477
/// <summary>
477-
/// The callback to invoke once the local client stops
478+
/// The callback to invoke once the local client stops.
478479
/// </summary>
479-
/// <remarks>The parameter states whether the client was running in host mode</remarks>
480+
/// <remarks>The bool parameter will be set to true when stopping a host client and false when stopping a standard client instance.</remarks>
480481
/// <param name="arg1">The first parameter of this event will be set to <see cref="true"/> when stopping the host client and <see cref="false"/> when stopping a standard client instance.</param>
481482
public event Action<bool> OnClientStopped = null;
482483

com.unity.netcode.gameobjects/Runtime/Serialization/NetworkBehaviourReference.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ namespace Unity.Netcode
55
{
66
/// <summary>
77
/// A helper struct for serializing <see cref="NetworkBehaviour"/>s over the network. Can be used in RPCs and <see cref="NetworkVariable{T}"/>.
8-
/// Note: network ids get recycled by the NetworkManager after a while. So a reference pointing to
8+
/// Network IDs get recycled by the NetworkManager after a while, so using a NetworkBehaviourReference for too long may result in a
9+
/// different NetworkBehaviour being returned for the assigned NetworkBehaviourId. NetworkBehaviourReferences are best for short-term
10+
/// use when receieved via RPC or custom message, rather than for long-term references to NetworkBehaviours.
911
/// </summary>
1012
public struct NetworkBehaviourReference : INetworkSerializable, IEquatable<NetworkBehaviourReference>
1113
{

0 commit comments

Comments
 (0)