Skip to main content

ActionGlyphAnimator

A class in Root.Township, the global namespace.

Pooled sprite that fades a skill practice glyph in and out. Spawned and placed by ActionGlyphsPlacer.

Constructors​

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

Fields​

6 private and internal fields
MemberWhat it is
private Renderer androidSpriteRendererSeparate renderer for Android. Not used in this class's code.
private DurationCurve fadeCurveCurve and duration used for the alpha fades.
private Coroutine fadingInCoroutineThe running fade in, if any.
private Coroutine fadingOutCoroutineThe running fade out, if any.
private Sprite nextGlyphSprite to show once the fade in starts.
private SpriteRenderer spriteRendererRenderer that shows the glyph sprite.

Methods​

MemberWhat it is
override void Release()Fades the glyph out first if it is showing or fading, then returns it to the pool.
void SetupGlyph(Sprite glyph)Changes the shown glyph with a fade. A null glyph fades the current one out.
protected override void OnDestroy()Only calls the base pooled object cleanup.
4 private and internal methods
MemberWhat it is
private void Awake()Hides the sprite and clears it.
private IEnumerator FadeAndRelease(Coroutine toWait) (iterator)Waits for a fade out to finish, then returns the object to its pool.
private IEnumerator FadeIn() (iterator)Waits for any fade out, sets the next glyph and fades its alpha in along fadeCurve.
private IEnumerator FadeOut() (iterator)Fades the alpha out along fadeCurve, then hides and clears the sprite.

Used in​

Members of other types that take, return or hold a ActionGlyphAnimator: