NumericalWidget
A class in Root.Township, the global namespace.
Debug widget that shows a number and builds up and down buttons for each digit, firing events when the value changes.
- Listed in Global namespace: M to O
- Inherits or implements
DebugWidget
Constructors
| Member | What it is |
|---|---|
NumericalWidget() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private AnalyticalButton buttonPrefab | Button prefab used for each digit. |
private float currentValue | The current value. |
private int decimalPlaces | Number of digits after the point. |
private bool isPercentage | If true, events get the value divided by 100. |
private float max | Highest value; also sets how many whole digits get buttons. |
private float min | Lowest value. |
private Renderer minusSignal | Renderer shown when the value is negative. |
private FloatUnityEvent onValueChanged | Event fired with the new value. |
private IntUnityEvent onValueChangedInt | Event fired with the new value cast to an int. |
private TextRenderer textRenderer | Text that shows the value. |