Skip to main content

PipAvailablePointManager

A class in Root.Township, the global namespace.

Shows a player's free progression points as a ring of pips that light up or dim. Client-side; it makes no pips on a headless server.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private float angleGapDegrees between pips.
private AvailablePointBar[] instantiatedThe spawned pips.
private AvailablePointBar pipPrefabPrefab for one pip.
private float startPipAngleAngle of the first pip.
private Queue<int> temporaryPipsIndexes of pips lit by OpenTemporary.

Methods​

MemberWhat it is
override void CleanTemporary()Dims every pip that OpenTemporary lit.
override void OpenTemporary(int index)Lights a pip and remembers it so CleanTemporary can dim it.
override void OpenVisual(int index)Lights the pip at the given index.
override void UpdateAvailablePointsVisual(int freePoints)Lights the first pips up to the free point count and dims the rest.
3 private and internal methods
MemberWhat it is
private void EnsureSetup()Spawns one pip per possible free point the first time it's needed, if not headless.
private void OnDrawGizmosSelected()Draws where the pips will go in the editor.
private void PlacePips(Action<int, Quaternion> positionMethod)Works out each pip's rotation around the forward axis and passes it to the callback.