Skip to main content

StatBarSimple.MaterialValue

A protected class in Root.Township, Alta.StatSystem. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

One float on a stat bar's material that can be set straight away or eased towards a target. Easing runs on the bar's Lerping event.

Constructors​

MemberWhat it is
MaterialValue(string property, StatBarSimple bar, float lerpSpeed)Creates a StatBarSimple.MaterialValue from property, bar and lerpSpeed.

Fields​

7 private and internal fields
MemberWhat it is
private StatBarSimple barThe stat bar whose material and Lerping event are used.
private float currentValueBacking field for CurrentValue.
private bool isLerpingTrue while hooked to the bar's Lerping event.
private float lerpSpeedHow fast the value moves towards the target, per second.
private float lerpTargetThe value being eased towards.
private Material materialThe bar's material that holds the property.
private int propertyIDShader property id of the float.

Properties​

MemberWhat it is
float Value { get; set; }Get or set the value directly. Setting it stops at the new value with no easing.
1 private and internal property
MemberWhat it is
private float CurrentValue { get; set; }The value currently on the material. Setting it writes the shader property.

Methods​

MemberWhat it is
void Lerp(float target)Starts easing towards a target at lerpSpeed per second, hooking the bar's Lerping event until it arrives. Sets it straight away if already there.
1 private and internal method
MemberWhat it is
private void Lerp(ref bool isLerping)Starts easing towards a target at lerpSpeed per second, hooking the bar's Lerping event until it arrives. Sets it straight away if already there.

Used in​

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