Skip to content
Snippets Groups Projects
Commit 2ccc33bb authored by Chang, Ryan's avatar Chang, Ryan
Browse files

Create terrain script test.

parent b30284e2
No related branches found
No related tags found
No related merge requests found
......@@ -13,8 +13,13 @@ using Unity.Mathematics;
[System.Serializable]
public struct Biome
{
public float heightMin;
[Tooltip("Larger value means more likely to be selected.")]
[Tooltip("The range of temperatures where this biome can generate.")]
public Vector2 temperatureRange;
[Tooltip("The range of moistures where this biome can generate.")]
public Vector2 moistureRange;
[Tooltip("The range of magic this biome can generate. Reserved for special biomes.")]
public Vector2 magicRange;
[Tooltip("Larger value means more likely to be selected if two different biomes could be selected.")]
public float probablity;
public List<Octave> octaves;
}
......@@ -22,8 +27,9 @@ public struct Biome
public class BiomeGenerator : TerrainGenerator
{
[Header("Biome settings")]
[Tooltip("Larger values mean smaller biomes.")]
[Tooltip("Larger values mean smaller/more biomes.")]
public float biomeGenerationFrequency = 1;
public override void Generate()
{
base.Generate();
......
using System.Collections;
using UnityEngine;
public class TerrainCreateTest : MonoBehaviour
{
private void Start()
{
// This should in theory generate a new terrain object.
TerrainData terrainData = new();
terrainData.size = new(512, 512, 512);
Terrain.CreateTerrainGameObject(terrainData);
}
}
\ No newline at end of file
......@@ -35,8 +35,12 @@ public class TerrainGenerator : MonoBehaviour
public bool refresh;
[Tooltip("How fine grain the generated terrain will be. Larger values = more precise.")]
public int xSamples = 1000, ySamples = 1000;
//[Tooltip("How many terrain elements are there?")]
//public Vector2Int terrainsSize = new(1,1);
[Tooltip("How fine grain the generated terrain will be. " +
"Larger values = more precise. Recommended value is 513.")]
public int xSamples = 513, ySamples = 513;
public virtual void Generate()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment