Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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