Skip to main content

Stretch

A class in Root.Township, Alta.Caves.PluginParts.

Cave map generator part that shapes a layer vertically from a height map, using a curve from floor (or roof) upward. Settings only; the work is done in StretchInstance.

Constructors​

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

Fields​

8 private and internal fields
MemberWhat it is
private float floorValueBacking field for FloorValue.
private Plugin heightMapLayerBacking field for HeightMapLayer.
private int heightMapYIndexBacking field for HeightMapYIndex.
private bool isFromRoofBacking field for IsFromRoof.
private float maximumValueBacking field for MaximumValue.
private float minimumValueBacking field for MinimumValue.
private OperationType operationTypeBacking field for OperationType.
private AnimationCurve stretchCurveBacking field for StretchCurve.

Properties​

MemberWhat it is
float FloorValue { get; }Added to the height map value before it is scaled by the curve.
Plugin HeightMapLayer { get; }Layer plugin read as the height map.
int HeightMapYIndex { get; }Which Y slice of the height map layer is read.
bool IsFromRoof { get; }When true, the curve runs from the top of the layer downward instead of from the bottom.
float MaximumValue { get; }Upper clamp for each written value.
float MinimumValue { get; }Lower clamp for each written value.
OperationType OperationType { get; }How the curve value combines with the existing layer value.
AnimationCurve StretchCurve { get; }Curve over the layer's height (0 at the start, 1 at the end) that scales the height map value.

Methods​

MemberWhat it is
override IPartInstance GetInstance(PluginInstance plugin)Creates the StretchInstance that runs this part on a plugin.

Used in​

Members of other types that take, return or hold a Stretch: