A class in Root.Township, the global namespace.
Links a set of selection levers so that moving one to selectionIndex moves all the others to desiredIndex, like radio buttons.
Constructors
| Member | What it is |
|---|
MultiLeverPanel() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private int desiredIndex | Index the other levers are reset to. |
private SelectionLever[] levers | The linked levers. |
private int selectionIndex | Index that counts as switched on (1 by default). |
Methods
2 private and internal methods
| Member | What it is |
|---|
private void HandleSelection(SelectionLever activatedLever, int oldIndex, int currentSelection) | When a lever reaches selectionIndex, sets every other lever to desiredIndex. |
private void Start() | Hooks SelectionChanged on every lever. |