Skip to main content

SkillOrbHolder

A class in Root.Township, the global namespace.

Client visual for one orb socket in the bought-skills display: animates rotator pieces open or closed and lerps a colour. Driven by BoughtSkillVisualizer.

Constructors​

MemberWhat it is
SkillOrbHolder()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 an open or close animation takes (0.5 by default).
private ColorLerp colorLerpColour lerp that lights the holder.
private bool hasSkillTrue when the holder was closed with a skill in it; the colour then stays lit during the animation.
private bool isOpenCurrent open state.
private QuaternionRotationSlerp[] rotatorsChild pieces that rotate as the holder opens and closes.
private Coroutine runningcoroutineThe animation coroutine currently running, stopped when a new one starts.
private float valueCurrent animation progress, 0 closed to 1 open.

Methods​

MemberWhat it is
void Close(bool isFillingSkill)Closes the holder. Pass true when a skill fills it, which keeps the colour lit.
void Open()Opens the holder and marks it as having no skill.
4 private and internal methods
MemberWhat it is
private IEnumerator Animate() (iterator)Coroutine that runs the rotators (and the colour, if no skill fills it) towards open or closed over animationDuration.
private IEnumerator AnimateColorOnly(bool isLittingUp) (iterator)Coroutine that fades only the colour up or down, used when closing a holder that was already closed.
private void OnValidate()Editor: fills rotators from child QuaternionRotationSlerp components if the list is empty.
private void SetValue(bool isOpen)Sets the open state and starts Animate if it changed. Does nothing visible on a headless server.

Used in​

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