-
-
Save todorok1/487d5bac50bba4da89d3707a8a297562 to your computer and use it in GitHub Desktop.
TerrainのHeightMapを生成するスクリプト(エディタ拡張のクラス)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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