Skip to main content

MultiLeverPanel

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​

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

Fields​

3 private and internal fields
MemberWhat it is
private int desiredIndexIndex the other levers are reset to.
private SelectionLever[] leversThe linked levers.
private int selectionIndexIndex that counts as switched on (1 by default).

Methods​

2 private and internal methods
MemberWhat 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.