Skip to content

Instantly share code, notes, and snippets.

@todorok1
Last active January 20, 2021 04:28
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/a6ae7e93afa0084a44ac1c56dd9449fb to your computer and use it in GitHub Desktop.
Save todorok1/a6ae7e93afa0084a44ac1c56dd9449fb to your computer and use it in GitHub Desktop.
エディタ上でパーリンノイズによる地形を生成するサンプル
public override void OnInspectorGUI()
{
var generator = (FieldGenerator) target;
DrawDefaultInspector();
if (GUILayout.Button("フィールドの生成"))
{
GenerateFieldOnEditor(generator);
}
EditorGUILayout.Space();
if (GUILayout.Button("フィールドパーツの削除"))
{
RemoveFieldParts(generator);
}
EditorGUILayout.Space();
if (GUILayout.Button("フィールドメッシュの結合"))
{
CombineFieldParts(generator);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment