Skip to content

CollectionExtensions Class

C#
public static class CollectionExtensions

Inheritance object

Returns a Unity.Collections.NativeArray1` that is a copy of this list.

C#
public static NativeArray<T> ToNativeArray<T>(this ScriptableList<T> list, Allocator allocator) where T : struct

list ScriptableList<T>
The list to copy.

allocator Unity.Collections.Allocator
The allocator to use.

Unity.Collections.NativeArray<T>
An array that is a copy of this list.

This method supports both struct and unmanaged types.