File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -632,12 +632,20 @@ public T this[int index]
632632 }
633633
634634 /// <summary>
635- /// Returns the contents of the NetworkList as a read-only NativeArray.
635+ /// Gets a **zero‑allocation**, read‑only
636+ /// <see cref="Unity.Collections.NativeArray{T}.ReadOnly"/> view over the current
637+ /// elements of this <see cref="NetworkList{T}"/>.
636638 /// </summary>
637639 /// <remarks>
638- /// This method returns the list contents as a NativeArray.ReadOnly. Be careful with the lifetime of the NativeArray.
640+ /// The returned array stays valid **only until** the list is mutated (add, remove,
641+ /// clear, resize) or the container is <see cref="Dispose()"/>d. Continuing to use
642+ /// it afterwards results in undefined behaviour; callers are responsible for
643+ /// ensuring a safe lifetime.
639644 /// </remarks>
640- /// <returns>A read-only NativeArray of the list contents.</returns>
645+ /// <returns>
646+ /// A read‑only <see cref="Unity.Collections.NativeArray{T}.ReadOnly"/> that shares
647+ /// the same backing memory as this list.
648+ /// </returns>
641649 public NativeArray < T > . ReadOnly AsNativeArray ( )
642650 {
643651 return m_List . AsReadOnly ( ) ;
You can’t perform that action at this time.
0 commit comments