示例#1
0
    // Loads cheap snapshot of chunk
    public void Snapshot()
    {
        if (state >= ChunkState.SNAPSHOTTED)
        {
            return;
        }

        Vector2Int center      = bounds.GetCenter();
        Vector2Int localCenter = GetLocalCoord(center);

        terrainSnapshot = TerrainGen.GenerateTerrainAt(center.x, center.y);
        terrainHeightMap[localCenter.x, localCenter.y] = terrainSnapshot;

        densitySnapshot = TerrainGen.CalculateDensityAtChunk(center);//CalculateDensityAt(center.x, center.y);
        densityMap[localCenter.x, localCenter.y] = densitySnapshot;

        state = ChunkState.SNAPSHOTTED;
    }