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 bea303f commit 7d04852Copy full SHA for 7d04852
com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs
@@ -631,6 +631,18 @@ public T this[int index]
631
}
632
633
634
+ /// <summary>
635
+ /// Returns the contents of the NetworkList as a read-only NativeArray.
636
+ /// </summary>
637
+ /// <remarks>
638
+ /// This method returns the list contents as a NativeArray.ReadOnly. Be careful with the lifetime of the NativeArray.
639
+ /// </remarks>
640
+ /// <returns>A read-only NativeArray of the list contents.</returns>
641
+ public NativeArray<T>.ReadOnly AsNativeArray()
642
+ {
643
+ return m_List.AsReadOnly();
644
+ }
645
+
646
private void HandleAddListEvent(NetworkListEvent<T> listEvent)
647
{
648
m_DirtyEvents.Add(listEvent);
0 commit comments