Skip to content

Commit 8b4e1cd

Browse files
style
Some additional minor updates to XML API.
1 parent f6f94d1 commit 8b4e1cd

File tree

14 files changed

+226
-224
lines changed

14 files changed

+226
-224
lines changed

com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class NetworkConfig
3232
public GameObject PlayerPrefab;
3333

3434
/// <summary>
35-
/// The collection of network prefabs available for spawning across the network
35+
/// The collection of network prefabs available for spawning across the network.
3636
/// </summary>
3737
[SerializeField]
3838
public NetworkPrefabs Prefabs = new NetworkPrefabs();

com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ public class NetworkPrefab
5858
public GameObject OverridingTargetPrefab;
5959

6060
/// <summary>
61-
/// Compares this NetworkPrefab with another to determine equality
61+
/// Compares this NetworkPrefab with another to determine equality.
6262
/// </summary>
63-
/// <param name="other">The NetworkPrefab to compare against</param>
64-
/// <returns>True if all fields match between the two NetworkPrefabs, false otherwise</returns>
63+
/// <param name="other">The NetworkPrefab to compare against.</param>
64+
/// <returns>True if all fields match between the two NetworkPrefabs, false otherwise.</returns>
6565
public bool Equals(NetworkPrefab other)
6666
{
6767
return Override == other.Override &&
@@ -72,11 +72,11 @@ public bool Equals(NetworkPrefab other)
7272
}
7373

7474
/// <summary>
75-
/// Gets the GlobalObjectIdHash of the source prefab based on the current override settings
75+
/// Gets the GlobalObjectIdHash of the source prefab based on the current override settings.
7676
/// </summary>
77-
/// <value>The hash value identifying the source prefab</value>
78-
/// <exception cref="InvalidOperationException">Thrown when required prefab references are missing or invalid</exception>
79-
/// <exception cref="ArgumentOutOfRangeException">Thrown when Override has an invalid value</exception>
77+
/// <value>The hash value identifying the source prefab.</value>
78+
/// <exception cref="InvalidOperationException">Thrown when required prefab references are missing or invalid.</exception>
79+
/// <exception cref="ArgumentOutOfRangeException">Thrown when Override has an invalid value.</exception>
8080
public uint SourcePrefabGlobalObjectIdHash
8181
{
8282
get
@@ -110,11 +110,11 @@ public uint SourcePrefabGlobalObjectIdHash
110110
}
111111

112112
/// <summary>
113-
/// Gets the GlobalObjectIdHash of the target prefab when using prefab overrides
113+
/// Gets the GlobalObjectIdHash of the target prefab when using prefab overrides.
114114
/// </summary>
115-
/// <value>The hash value identifying the target prefab, or 0 if no override is set</value>
116-
/// <exception cref="InvalidOperationException">Thrown when required prefab references are missing or invalid</exception>
117-
/// <exception cref="ArgumentOutOfRangeException">Thrown when Override has an invalid value</exception>
115+
/// <value>The hash value identifying the target prefab, or 0 if no override is set.</value>
116+
/// <exception cref="InvalidOperationException">Thrown when required prefab references are missing or invalid.</exception>
117+
/// <exception cref="ArgumentOutOfRangeException">Thrown when Override has an invalid value.</exception>
118118
public uint TargetPrefabGlobalObjectIdHash
119119
{
120120
get
@@ -140,10 +140,10 @@ public uint TargetPrefabGlobalObjectIdHash
140140
}
141141

142142
/// <summary>
143-
/// Validates the NetworkPrefab configuration to ensure all required fields are properly set
143+
/// Validates the NetworkPrefab configuration to ensure all required fields are properly set.
144144
/// </summary>
145-
/// <param name="index">Optional index used for error reporting when validating lists of prefabs</param>
146-
/// <returns>True if the NetworkPrefab is valid and ready for use, false otherwise</returns>
145+
/// <param name="index">Optional index used for error reporting when validating lists of prefabs.</param>
146+
/// <returns>True if the NetworkPrefab is valid and ready for use, false otherwise.</returns>
147147
public bool Validate(int index = -1)
148148
{
149149
NetworkObject networkObject;
@@ -247,9 +247,9 @@ public bool Validate(int index = -1)
247247
}
248248

249249
/// <summary>
250-
/// Returns a string representation of this NetworkPrefab's source and target hash values
250+
/// Returns a string representation of this NetworkPrefab's source and target hash values.
251251
/// </summary>
252-
/// <returns>A string containing the source and target hash values</returns>
252+
/// <returns>A string containing the source and target hash values.</returns>
253253
public override string ToString()
254254
{
255255
return $"{{SourceHash: {SourceHashToOverride}, TargetHash: {TargetPrefabGlobalObjectIdHash}}}";

com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ public class NetworkPrefabs
3434
/// This is used for the legacy way of spawning NetworkPrefabs with an override when manually instantiating and spawning.
3535
/// To handle multiple source NetworkPrefab overrides that all point to the same target NetworkPrefab use
3636
/// <see cref="NetworkSpawnManager.InstantiateAndSpawn(NetworkObject, ulong, bool, bool, bool, Vector3, Quaternion)"/>
37-
/// or <see cref="NetworkObject.InstantiateAndSpawn(NetworkManager, ulong, bool, bool, bool, Vector3, Quaternion)"/>
37+
/// or <see cref="NetworkObject.InstantiateAndSpawn(NetworkManager, ulong, bool, bool, bool, Vector3, Quaternion)"/>.
3838
/// </summary>
3939
[NonSerialized]
4040
public Dictionary<uint, uint> OverrideToNetworkPrefab = new Dictionary<uint, uint>();
4141

4242
/// <summary>
43-
/// Gets the read-only list of all registered network prefabs
43+
/// Gets the read-only list of all registered network prefabs.
4444
/// </summary>
4545
public IReadOnlyList<NetworkPrefab> Prefabs => m_Prefabs;
4646

@@ -66,16 +66,15 @@ private void RemoveTriggeredByNetworkPrefabList(NetworkPrefab networkPrefab)
6666
}
6767

6868
/// <summary>
69-
/// Finalizer that ensures proper cleanup of network prefab resources
69+
/// Destructor that cleans up network prefab resources.
7070
/// </summary>
7171
~NetworkPrefabs()
7272
{
7373
Shutdown();
7474
}
7575

7676
/// <summary>
77-
/// Deregister from add and remove events
78-
/// Clear the list
77+
/// Deregister from add and remove events and clear the events.
7978
/// </summary>
8079
internal void Shutdown()
8180
{
@@ -90,7 +89,7 @@ internal void Shutdown()
9089
/// Processes the <see cref="NetworkPrefabsList"/> if one is present for use during runtime execution,
9190
/// else processes <see cref="Prefabs"/>.
9291
/// </summary>
93-
/// <param name="warnInvalid">When true, logs warnings about invalid prefabs that are removed during initialization</param>
92+
/// <param name="warnInvalid">When true, logs warnings about invalid prefabs that are removed during initialization.</param>
9493
public void Initialize(bool warnInvalid = true)
9594
{
9695
m_Prefabs.Clear();
@@ -161,13 +160,12 @@ public void Initialize(bool warnInvalid = true)
161160
}
162161

163162
/// <summary>
164-
/// Add a new NetworkPrefab instance to the list
163+
/// Add a new NetworkPrefab instance to the list.
165164
/// </summary>
166-
/// <param name="networkPrefab">The NetworkPrefab to add</param>
165+
/// <param name="networkPrefab">The <see cref="NetworkPrefab"/> to add.</param>
167166
/// <returns>True if the prefab was successfully added, false if it was invalid or already registered</returns>
168167
/// <remarks>
169-
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
170-
///
168+
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.<br />
171169
/// Any modifications made here are not persisted. Permanent configuration changes should be done
172170
/// through the <see cref="NetworkPrefabsList"/> scriptable object property.
173171
/// </remarks>
@@ -184,12 +182,11 @@ public bool Add(NetworkPrefab networkPrefab)
184182
}
185183

186184
/// <summary>
187-
/// Remove a NetworkPrefab instance from the list
185+
/// Remove a NetworkPrefab instance from the list.
188186
/// </summary>
189-
/// <param name="prefab">The NetworkPrefab to remove</param>
187+
/// <param name="prefab">The <see cref="NetworkPrefab"/> to remove.</param>
190188
/// <remarks>
191-
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
192-
///
189+
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.<br />
193190
/// Any modifications made here are not persisted. Permanent configuration changes should be done
194191
/// through the <see cref="NetworkPrefabsList"/> scriptable object property.
195192
/// </remarks>
@@ -207,12 +204,11 @@ public void Remove(NetworkPrefab prefab)
207204
}
208205

209206
/// <summary>
210-
/// Remove a NetworkPrefab instance with matching <see cref="NetworkPrefab.Prefab"/> from the list
207+
/// Remove a NetworkPrefab instance with matching <see cref="NetworkPrefab.Prefab"/> from the list.
211208
/// </summary>
212-
/// <param name="prefab">The GameObject to match against for removal</param>
209+
/// <param name="prefab">The <see cref="GameObject"/> to match against for removal.</param>
213210
/// <remarks>
214-
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
215-
///
211+
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.<br />
216212
/// Any modifications made here are not persisted. Permanent configuration changes should be done
217213
/// through the <see cref="NetworkPrefabsList"/> scriptable object property.
218214
/// </remarks>
@@ -243,10 +239,10 @@ public void Remove(GameObject prefab)
243239
}
244240

245241
/// <summary>
246-
/// Check if the given GameObject is present as a prefab within the list
242+
/// Check if the given GameObject is present as a prefab within the list.
247243
/// </summary>
248-
/// <param name="prefab">The prefab to check</param>
249-
/// <returns>Whether or not the prefab exists</returns>
244+
/// <param name="prefab">The prefab to check.</param>
245+
/// <returns>True if the prefab exists or false if it does not.</returns>
250246
public bool Contains(GameObject prefab)
251247
{
252248
for (int i = 0; i < m_Prefabs.Count; i++)
@@ -262,10 +258,10 @@ public bool Contains(GameObject prefab)
262258
}
263259

264260
/// <summary>
265-
/// Check if the given NetworkPrefab is present within the list
261+
/// Check if the given NetworkPrefab is present within the list.
266262
/// </summary>
267-
/// <param name="prefab">The prefab to check</param>
268-
/// <returns>Whether or not the prefab exists</returns>
263+
/// <param name="prefab">The prefab to check.</param>
264+
/// <returns>True if the prefab exists or false if it does not.</returns>
269265
public bool Contains(NetworkPrefab prefab)
270266
{
271267
for (int i = 0; i < m_Prefabs.Count; i++)
@@ -280,7 +276,7 @@ public bool Contains(NetworkPrefab prefab)
280276
}
281277

282278
/// <summary>
283-
/// Configures <see cref="NetworkPrefabOverrideLinks"/> for the given <see cref="NetworkPrefab"/>
279+
/// Configures <see cref="NetworkPrefabOverrideLinks"/> for the given <see cref="NetworkPrefab"/>.
284280
/// </summary>
285281
private bool AddPrefabRegistration(NetworkPrefab networkPrefab)
286282
{

0 commit comments

Comments
 (0)