Skip to main content

ClimbingTowerProgressionVisualizer

A class in Root.Township, Features.Gameplay.ClimbingTower.

Climbing tower gauge and rune display. On clients it lights the rune for the highest orb the local player has and sets the gauge marker to that rune's height. The rune settings are saved.

Constructors​

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

Fields​

8 private and internal fields
MemberWhat it is
private static readonly int _FillProgressShader property ID for the gauge fill.
private static readonly int _FurthestPointShader property ID for the gauge's furthest point marker.
private Material instantiatedMaterialBacking field for InstantiatedMaterial.
private static readonly Logger loggerNLog logger for this class.
private const int MaximumVisualizerGaugeValueUpper clamp for the gauge height value, 3.
private List<ClimbingTowerProgressionVisualizer.RuneActivationElement> runeActivationElementsRunes, each with its particle object, the orb index that lights it and its gauge height.
private MethodSyncClass<List<ClimbingTowerProgressionVisualizer.RuneActivationElement>> syncRuneActivationElementsMethod sync for the rune settings.
private Renderer[] teleporterGaugesGauge renderers that share the instanced material.

Properties​

1 private and internal property
MemberWhat it is
private Material InstantiatedMaterial { get; }Gauge material instance, created from the first gauge on first use and shared by all gauges.

Methods​

MemberWhat it is
override void Initialize()Creates the syncRuneActivationElements method sync on SyncC.
void Load(ClimbingTowerProgressionVisualizerSaveData data, ISerializeChildren childSerializer)Restores each rune's orb index and gauge height from save data, keeping the scene's particle objects.
ClimbingTowerProgressionVisualizerSaveData Save(ISerializeChildren childSerializer)Saves each rune's orb index and gauge height.
void SetGaugeMaterialProgression(float progress)Sets the gauge fill (_FillProgress) to a value clamped from 0 to 1.
11 private and internal methods
MemberWhat it is
private void OnDestroy()Unhooks player events and destroys the instanced material.
private void OnDisable()Unhooks the unlock manager's Modified event.
private void OnEnable()Client: sets up for the local player now, or waits for Player.LocalPlayerSet.
private void IBuildRendererPostBake.PostBake()Build step that removes missing renderers from teleporterGauges.
private void RemoveRuneUpdateFromModificationEvent()Unhooks UpdateActiveTeleporterRunes from the local player's unlock manager.
private void SetHeightPointOnGauge(float heightPoint)Sets the gauge's furthest point (_FurthestPoint), clamped from 0 to 3.
private void SetTeleporterRuneAsActive(ClimbingTowerProgressionVisualizer.RuneActivationElement activationElement)Turns on the rune's particles and moves the gauge marker to its height.
private void SetTeleporterRuneAsInactive(ClimbingTowerProgressionVisualizer.RuneActivationElement activationElement)Turns off the rune's particles.
private void Setup(IPlayer player)Hooks the local player's unlock manager Modified event and refreshes the runes.
private void SyncRuneActivationElements(IPlayer player, Stream stream, List<ClimbingTowerProgressionVisualizer.RuneActivationElement> runeActivationElementsToSync)Writes or reads each rune's orb index and gauge height; remote clients then refresh the runes. Nothing in this class sends it.
private void UpdateActiveTeleporterRunes()Client: lights only the last rune whose orb the local player has, and turns the others off.