Skip to main content

AvailablePointBar

A class in Root.Township, the global namespace.

Client: one pip showing an unspent progression point. PipAvailablePointManager makes one per possible free point and lights or dims them by fading the material's _Alpha.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private static readonly int _AlphaShader property ID for _Alpha.
private Renderer animatingRendererRenderer whose material alpha is faded.
private float litProgressAlpha used when lit.
private Coroutine runningAnimationThe fade coroutine in progress, if any.

Methods​

MemberWhat it is
void Dim()Fades the pip out to 0.
void InstantSetToAlpha(float alpha)Sets the material's alpha at once.
void Light()Fades the pip up to litProgress.
4 private and internal methods
MemberWhat it is
private void Animate(float target)Starts fading alpha to the target, stopping any fade already running.
private void Awake()Starts the pip fully transparent, except on headless servers.
private void OnValidate()Fills in the renderer from this object if it is empty.
private IEnumerator RunAnimation(float target) (iterator)Coroutine that lerps alpha to the target over a time equal to the alpha difference.

Used in​

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