Exemple #1
0
            public void Execute(int index)
            {
                var chunk      = Chunks[index].m_Chunk;
                var flags      = Flags[index];
                var startIndex = EntityCounts[index];

                var archetype = chunk->Archetype;
                var entityGuidIndexInArchetype = ChunkDataUtility.GetIndexInTypeArray(archetype, EntityGuidTypeIndex);
                var entityGuidBuffer           = (EntityGuid *)(ChunkDataUtility.GetChunkBuffer(chunk) + archetype->Offsets[entityGuidIndexInArchetype]);

                var entitiesIndex = startIndex;

                for (var i = 0; i < chunk->Count; ++i)
                {
                    Entities[entitiesIndex++] = new EntityInChunkWithGuid
                    {
                        EntityInChunk = new EntityInChunk {
                            Chunk = chunk, IndexInChunk = i
                        },
                        EntityGuid = entityGuidBuffer[i],
                        Flags      = flags
                    };
                }
            }