We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3da80e7 commit 30b0cfbCopy full SHA for 30b0cfb
com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs
@@ -632,6 +632,18 @@ public T this[int index]
632
}
633
634
635
+ /// <summary>
636
+ /// Returns the contents of the NetworkList as a read-only NativeArray.
637
+ /// </summary>
638
+ /// <remarks>
639
+ /// This method returns the list contents as a NativeArray.ReadOnly. Be careful with the lifetime of the NativeArray.
640
+ /// </remarks>
641
+ /// <returns>A read-only NativeArray of the list contents.</returns>
642
+ public NativeArray<T>.ReadOnly AsNativeArray()
643
+ {
644
+ return m_List.AsReadOnly();
645
+ }
646
+
647
private void HandleAddListEvent(NetworkListEvent<T> listEvent)
648
{
649
m_DirtyEvents.Add(listEvent);
0 commit comments