I found a few threads on this but there has to be an easier way for something so simple.
Can we get something like this outside of the entities package? Method ToNativeArray | Entities | 1.0.11
I found a few threads on this but there has to be an easier way for something so simple.
Can we get something like this outside of the entities package? Method ToNativeArray | Entities | 1.0.11
Depends if you want to alias the original array or not. In that case need to pin the managed array, get the pointer and convert existing data into native array. If you want to copy just create a native array with the same length and copy elements one by one.
How easy do you want it to be? Which solution you have at hand but don’t consider easy?
I vaguely recalled that there is such a thing. I think it‘s CopyFromNBC (not Burst compatible): Class Extensions | Collections | 2.5.1
Though this creates a list, you can extract or convert the underlying list buffer as an array. Or just keep using the list, doesn‘t matter much performance wise.
Thanks CodeSmile, exactly what I was lookin for.