Unity-Technologies / EntityComponentSystemSamples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Examples/Jobs IJobChunk Doesn't Work

coarsecrunch opened this issue · comments

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 entities = chunk.GetNativeArray(ref EntityHandle);

Should instead be:

NativeArray entities = chunk.GetNativeArray(EntityHandle);

EntityTypeHandle has to be passed by value GetNativeArray.