Assets/Scripts/Jobs/GenerateGroundJob.cs
@@ -22,6 +22,7 @@ [WriteOnly] public NativeArray<bool> groundTiles; [ReadOnly] public NativeArray<float> perlinNoiseCache; public void Execute(int index) { @@ -33,11 +34,7 @@ groundTiles[index] = false; return; } float xPerlin = ((float)x / maxWidth) * scale + offsetX; float yPerlin = ((float)math.abs(y) / groundDepth) * scale + offsetY; float perlinNoise = noise.cnoise(new float2(xPerlin, yPerlin)); groundTiles[index] = perlinNoise <= 0.7f; groundTiles[index] = perlinNoiseCache[x * groundDepth + Mathf.Abs(y)] <= 0.7f; } }