EntityComponentSystemSamples
EntityComponentSystemSamples copied to clipboard
Examples/Jobs IJobChunk Doesn't Work
Docs/examples/jobs.md
[BurstCompile]
public void Execute(in ArchetypeChunk chunk,
int unfilteredChunkIndex,
bool useEnableMask,
in v128 chunkEnabledMask)
{
// Get the entity ID and component arrays from the chunk.
NativeArray<Entity> entities =
chunk.GetNativeArray(ref EntityHandle);
NativeArray<Foo> foos =
chunk.GetNativeArray(ref FooHandle);
NativeArray<Bar> bars =
chunk.GetNativeArray(ref BarHandle);
NativeArray<Entity> entities = chunk.GetNativeArray(ref EntityHandle);
Should instead be:
NativeArray<Entity> entities = chunk.GetNativeArray(EntityHandle);
EntityTypeHandle has to be passed by value GetNativeArray.