Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created January 7, 2021 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todorok1/487d5bac50bba4da89d3707a8a297562 to your computer and use it in GitHub Desktop.
Save todorok1/487d5bac50bba4da89d3707a8a297562 to your computer and use it in GitHub Desktop.
TerrainのHeightMapを生成するスクリプト(エディタ拡張のクラス)
/// <Summary>
/// TerrainのHeightMapを初期化します。
/// </Summary>
void ResetHeightMap(TerrainGenerator generator)
{
int terrainSizeX = generator.terrainData.heightmapResolution;
int terrainSizeZ = generator.terrainData.heightmapResolution;
float[,] newHeightMap = new float[terrainSizeX, terrainSizeZ];
generator.terrainData.SetHeights(0, 0, newHeightMap);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment