A class in Root.Township, Alta.Meta.UI.
Client UI: scales its targets up along a curve when enabled, and can scale them down then switch to another object. Locks UI actions while animating.
Constructors
| Member | What it is |
|---|
ScalingFadeAnimator() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|
private float currentTime | Normalised animation time. |
private GameObject enableOnFinish | Object to show when the scale-down ends. |
private AnimationCurve scaleOverTime | Curve of scale over time; its last key sets the duration. |
private Coroutine scaling | The running scale coroutine. |
private Transform[] targets | Transforms scaled by the animation. |
private float targetTime | Time being animated to: 1 to show, 0 to hide. |
Methods
| Member | What it is |
|---|
void Fade(GameObject fadeTo) | Scales down, then hides this object and shows the given one. Ignored while UI actions are locked. |
void Fade(GameObject fadeTo, Action onComplete) | Scales down, then hides this object and shows the given one. Ignored while UI actions are locked. |
3 private and internal methods
| Member | What it is |
|---|
private void OnDestroy() | Releases its UI action lock. |
private void OnEnable() | Starts scaling up from zero. |
private IEnumerator ScalingCoroutine(Action onComplete = null) (iterator) | Moves the animation time to its target, applying the curve to every target's scale, then finishes the switch. |
Used in
Members of other types that take, return or hold a ScalingFadeAnimator: