예제 #1
0
 private void onAlreadyExistingChunk(TerrainChunk chunk)
 {
     if (chunk.GetDistanceFrom(viewerPosition) <= maxViewDistance)
     {
         chunk.Show();
         lastVisibleChunks.Add(chunk);
     }
     else
     {
         chunk.Hide();
     }
 }
예제 #2
0
        private void onNewChunk(Vector2 chunkCoord)
        {
            var chunk = new TerrainChunk(chunkCoord, chunkSize, material);

            chunks.Add(chunkCoord, chunk);
        }
예제 #3
0
 private int resolveLevelOfDetailForChunk(TerrainChunk chunk)
 {
     return(Mathf.FloorToInt((chunk.GetDistanceFrom(viewerPosition) / maxViewDistance) * MapGenerator.LevelsOfDetail));
 }