Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created January 7, 2021 09:57
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/9b139488f9253c58a94678180137e782 to your computer and use it in GitHub Desktop.
Save todorok1/9b139488f9253c58a94678180137e782 to your computer and use it in GitHub Desktop.
TerrainのHeightMapを生成するスクリプト(設定を保持するクラス)
using UnityEngine;
/// <Summary>
/// Terrainのハイトマップ(HeightMap)を生成するクラスです。
/// </Summary>
public class TerrainGenerator : MonoBehaviour
{
// 高さを変更するTerrainのデータをアサインします。
public TerrainData terrainData;
// パーリンノイズに関する情報です。
public float xOrigin;
public float yOrigin;
public float scale = 0.03f;
// 高さの補正値です。
public float heightMultiply = 1f;
// パーリンノイズのオフセットで使用する乱数のシードです。
public int seed = 0;
// パーリンノイズを重ね合わせる回数を設定します。
public int multipleTimes = 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment