Skip to main content

ButtonGroup

A class in Root.Township, Alta.ScreenshotCamera.

Group of hand camera touch buttons that expand out and fold back in when toggled.

Constructors​

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

Fields​

7 private and internal fields
MemberWhat it is
private float animationDurationSeconds the expand or fold takes.
private float animationProgress0 folded, 1 fully out.
private HandCamera baseCameraThe hand camera the group belongs to.
private Object[] buttonsThe touch buttons (ITouchScreenButton).
private bool isActiveTrue when expanded or expanding.
private bool isAnimatingTrue while animating.
private Vector3[] positionsEach button's expanded local position.

Methods​

MemberWhat it is
void Toggle()Expands or folds the buttons, unless already animating.
3 private and internal methods
MemberWhat it is
private void Awake()Hooks the camera's owner change.
private IEnumerator ExpandAnimation() (iterator)Coroutine that moves and scales the buttons out or in, enabling them once fully out and hiding them once in.
private void OwnerUpdate(bool isowned)When the camera becomes owned, records the buttons' positions and folds them away hidden.