@@ -34,11 +34,14 @@ 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
42+ /// <summary>
43+ /// Gets the read-only list of all registered network prefabs.
44+ /// </summary>
4245 public IReadOnlyList < NetworkPrefab > Prefabs => m_Prefabs ;
4346
4447 [ NonSerialized ]
@@ -62,14 +65,16 @@ private void RemoveTriggeredByNetworkPrefabList(NetworkPrefab networkPrefab)
6265 m_Prefabs . Remove ( networkPrefab ) ;
6366 }
6467
68+ /// <summary>
69+ /// Destructor that cleans up network prefab resources.
70+ /// </summary>
6571 ~ NetworkPrefabs ( )
6672 {
6773 Shutdown ( ) ;
6874 }
6975
7076 /// <summary>
71- /// Deregister from add and remove events
72- /// Clear the list
77+ /// Deregister from add and remove events and clear the events.
7378 /// </summary>
7479 internal void Shutdown ( )
7580 {
@@ -84,6 +89,7 @@ internal void Shutdown()
8489 /// Processes the <see cref="NetworkPrefabsList"/> if one is present for use during runtime execution,
8590 /// else processes <see cref="Prefabs"/>.
8691 /// </summary>
92+ /// <param name="warnInvalid">When true, logs warnings about invalid prefabs that are removed during initialization.</param>
8793 public void Initialize ( bool warnInvalid = true )
8894 {
8995 m_Prefabs . Clear ( ) ;
@@ -154,11 +160,12 @@ public void Initialize(bool warnInvalid = true)
154160 }
155161
156162 /// <summary>
157- /// Add a new NetworkPrefab instance to the list
163+ /// Add a new NetworkPrefab instance to the list.
158164 /// </summary>
165+ /// <param name="networkPrefab">The <see cref="NetworkPrefab"/> to add.</param>
166+ /// <returns>True if the prefab was successfully added, false if it was invalid or already registered</returns>
159167 /// <remarks>
160- /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
161- ///
168+ /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.<br />
162169 /// Any modifications made here are not persisted. Permanent configuration changes should be done
163170 /// through the <see cref="NetworkPrefabsList"/> scriptable object property.
164171 /// </remarks>
@@ -175,11 +182,11 @@ public bool Add(NetworkPrefab networkPrefab)
175182 }
176183
177184 /// <summary>
178- /// Remove a NetworkPrefab instance from the list
185+ /// Remove a NetworkPrefab instance from the list.
179186 /// </summary>
187+ /// <param name="prefab">The <see cref="NetworkPrefab"/> to remove.</param>
180188 /// <remarks>
181- /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
182- ///
189+ /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.<br />
183190 /// Any modifications made here are not persisted. Permanent configuration changes should be done
184191 /// through the <see cref="NetworkPrefabsList"/> scriptable object property.
185192 /// </remarks>
@@ -197,11 +204,11 @@ public void Remove(NetworkPrefab prefab)
197204 }
198205
199206 /// <summary>
200- /// 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.
201208 /// </summary>
209+ /// <param name="prefab">The <see cref="GameObject"/> to match against for removal.</param>
202210 /// <remarks>
203- /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
204- ///
211+ /// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.<br />
205212 /// Any modifications made here are not persisted. Permanent configuration changes should be done
206213 /// through the <see cref="NetworkPrefabsList"/> scriptable object property.
207214 /// </remarks>
@@ -232,10 +239,10 @@ public void Remove(GameObject prefab)
232239 }
233240
234241 /// <summary>
235- /// 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.
236243 /// </summary>
237- /// <param name="prefab">The prefab to check</param>
238- /// <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>
239246 public bool Contains ( GameObject prefab )
240247 {
241248 for ( int i = 0 ; i < m_Prefabs . Count ; i ++ )
@@ -251,10 +258,10 @@ public bool Contains(GameObject prefab)
251258 }
252259
253260 /// <summary>
254- /// Check if the given NetworkPrefab is present within the list
261+ /// Check if the given NetworkPrefab is present within the list.
255262 /// </summary>
256- /// <param name="prefab">The prefab to check</param>
257- /// <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>
258265 public bool Contains ( NetworkPrefab prefab )
259266 {
260267 for ( int i = 0 ; i < m_Prefabs . Count ; i ++ )
@@ -269,7 +276,7 @@ public bool Contains(NetworkPrefab prefab)
269276 }
270277
271278 /// <summary>
272- /// Configures <see cref="NetworkPrefabOverrideLinks"/> for the given <see cref="NetworkPrefab"/>
279+ /// Configures <see cref="NetworkPrefabOverrideLinks"/> for the given <see cref="NetworkPrefab"/>.
273280 /// </summary>
274281 private bool AddPrefabRegistration ( NetworkPrefab networkPrefab )
275282 {
0 commit comments