Skip to main content

TouchScreenButtonGrower

A class in Root.Township, the global namespace.

Scales a TouchScreenButtonOld along a curve while it is pressed, and snaps it back to its starting size on release. Client-side visual only.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private TouchScreenButtonOld buttonThe button being scaled.
private AnimationCurve growCurveScale multiplier over normalised time 0 to 1.
private float growDurationSeconds the grow takes.
private AltaCoroutine growRoutineThe running grow coroutine, or null.
private Vector3 startingScaleThe button's local scale at Start.

Methods​

5 private and internal methods
MemberWhat it is
private IEnumerator GrowButton() (iterator)Coroutine that scales the button by growCurve over growDuration seconds.
private void OnDisable()Resets the button's scale.
private void ResetScale()Stops any grow in progress and restores the starting scale. Called on release.
private void Start()Hooks the button's press and release events and records its starting scale.
private void StartGrow()Restarts the grow coroutine. Called on press.