Newer
Older
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Master class for biome generation.
/// </summary>
public class BiomeMaster : MonoBehaviour
{
[Header("Biome Parameters")]
[InfoBox("Contains the parameters required for each biome.")]
[Header("Biome Data")]
[InfoBox("Contains the actual biomes. Each biome targets one or more biome " +
"parameters. Every point on the terrain will be assigned a biome, " +
"depending on how close the calculated " +
"parameters are to the parameter target of that biome.")]
[Header("Debug")]
public int debugSize = 500;
public float debugFrequency = 0.1f;
float x = i * debugFrequency;
float y = j * debugFrequency;
param.DrawDebug(x + mu, y + mu);
mu += debugFrequency / 10;
private void ReseedParameters()
{
foreach (var param in parameters)
{
param.ReseedOctaves();
}
}
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
[Button("Reseed Biome Data")]
private void ReseedData()
{
foreach (var data in datas)
{
data.ReseedOctaves();
}
}
[Button("Reseed All")]
private void ReseedAll()
{
ReseedData();
ReseedParameters();
}
[Button("Reset Biome Data")]
private void ResetData()
{
foreach (var d in datas)
{
d.ResetParamTargets(parameters);
}
}
#endregion
#region Biome Data Generation
private void UpdateDataTemplate()
{
foreach (var param in parameters)
{
}
}