Skip to main content

Section

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​

MemberWhat it is
Section()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

3 private and internal fields
MemberWhat it is
private AttributeCurveValue[] attributeMultipliersAttribute curves applied over the section's length.
private BiomeSingleValue[] biomeWeightingsBiomes this section can pick, with their weights.
private int lengthBacking field for Length.

Properties​

MemberWhat it is
int Length { get; }Number of layers in the section.

Methods​

MemberWhat 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: