public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex) { NativeArray <CoordinatesComponent> coordinatesArray = chunk.GetNativeArray(Coordinates); NativeArray <BlockTypesComponent> blockTypesArray = chunk.GetNativeArray(BlockTypes); SeedComponent seed = chunk.GetChunkComponentData(Seed); for (int i = 0; i < chunk.Count; i++) { int3 coordinates = coordinatesArray[i].Coordinates; ReadonlyVector3Int heights = TerrainGenerator.CalculateHeights_NoiseSampler(seed.Seed, coordinates.x, coordinates.z); blockTypesArray[i] = new BlockTypesComponent() { BlockType = TerrainGenerator.DetermineType_NoiseSampler(seed.Seed, coordinates.x, coordinates.y, coordinates.z, in heights) }; } } }
public void Execute(int i) { Utils.IndexDeflattenizer2D(i, TotalBlockNumberX, out int x, out int z); Result[i] = TerrainGenerator.CalculateHeights_NoiseSampler(Seed, x, z); }