Skip to main content

IntegerVisual

A class in Root.Township, the global namespace.

Shows a small integer as a fan of bars, one shown per point of value. Used by Mould for its remaining uses.

Constructors​

MemberWhat it is
IntegerVisual()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

6 private and internal fields
MemberWhat it is
private float angleRangeTotal angle the bars fan across (default 70).
private GameObject barPrefabPrefab for one bar.
private int maxNumber of bars (default 3).
private GameObject[] spawnedBarsThe spawned bar objects.
private bool testButtonEditor button to test the visual.
private int valueBacking field for Value.

Properties​

MemberWhat it is
int Value { get; internal set; }The number shown. Setting it (internal) updates the bars.

Methods​

MemberWhat it is
void UpdateBars()Shows the first Value bars and hides the rest.
3 private and internal methods
MemberWhat it is
private void SetupAllBars()Spawns max bars once, spread across the angle range.
private GameObject SpawnBar(int i, int barCount)Instantiates one bar and rotates it to its place in the fan.
private void Start()Spawns the bars and shows the current value.

Used in​

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