-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instead of using arrays directly, use a wrapped collection for StructHeap and IdArray #41
Comments
Hm, class StructHeap<T> {
internal T[] components;
...
} I assume these class Archetype {
internal int[] entityIds;
...
} Friflo ECS must not have any dependency to Unity types like NativeArray<>. So the only way I see to use var nativeComponents = new NativeArray(components, Allocator.None) Related to this also Note: Can you show a code snippet how you use components inside a Unity Job? |
You reminded me. My code is simple:
What I meant was not to change friflo to directly use NativeArray, but to wrap the Array instead. This would allow me to only modify a small part of the code myself. But I'll test |
These code could work!
|
I write an extension method for Chunk and ChunkEntities to convert span to NativeArray. So, this proposal is not neccesary. |
I am using Friflo in Unity, and I want to use job system with it. But Unity can only use value types (NativeArray etc.) in the job system. So I must modify a lot of code. But if Friflo uses a wrapped collection, then I only need to modify a little code.
And this proposal depends on the Dispose proposal: #40
The text was updated successfully, but these errors were encountered: