Hey guys, this is more of a C# question I think but I am using a multiplayer package and one of the collections they provide is a “network dictionary” where the key and value are unmanaged.
I was wondering if its possible to use this in a burst job? Or is there an easy way to convert it to a unity collection? Using system.linq or something? I could iterate over it but I was wondering if there is a more performant way.
It’s a class, which Burst doesn’t support. If the internals are completely unmanaged all the way down, you could hackily pass in the unmanaged bits and use that directly. Otherwise, you’ll need to copy over key-value pairs.
Hey thx for reply Spy-Master. I see linq has a .ToArray, etc, that I could use but I’m not sure how expensive it would be. It probably best if I just build new collections.
ToArray won’t help because it returns a managed array. Native collections are not serializable. So either you build a custom collection or write a serialization solution for native collections.