Method CreateOrResizeNativeArrayIfNecessary
CreateOrResizeNativeArrayIfNecessary<T>(int, Allocator, ref NativeArray<T>)
Creates or resizes the array if necessary. If array has been allocated
and its length is equal to length, then this method does nothing. If its length is
different, then it is first disposed before being assigned to a new NativeArray.
Declaration
protected static void CreateOrResizeNativeArrayIfNecessary<T>(int length, Allocator allocator, ref NativeArray<T> array) where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| int | length | The length that |
| Allocator | allocator | If allocation is necessary, this allocator will be used to create the new |
| NativeArray<T> | array | The array to create or resize. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of elements held by the |