A class in Root.Township, Alta.Caves.
Cave generation asset for a run of layers: how many layers, which biomes they can be and how attributes change through them.
Constructors
| Member | What it is |
|---|
Section() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private AttributeCurveValue[] attributeMultipliers | Attribute curves applied over the section's length. |
private BiomeSingleValue[] biomeWeightings | Biomes this section can pick, with their weights. |
private int length | Backing field for Length. |
Properties
| Member | What it is |
|---|
int Length { get; } | Number of layers in the section. |
Methods
| Member | What it is |
|---|
void ApplyMultipliers(int layer, AttributeSet attributes) | Multiplies each listed attribute by its curve, evaluated at how far the layer is through the section. |
Biome GetRandomBiome(Biome excluding = null) | Picks a biome by weight, optionally excluding one (for example the previous layer's). |
Used in
Members of other types that take, return or hold a Section: