Skip to main content

CaveTeleporterPip

A class in Root.Township, Alta.Caves.

Client visual for one cave layer in the cave teleporter's level selector: shows whether the target layer is known and fuelled, and fades in when selected. Spawned by LevelSelector.

Constructors​

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

Fields​

10 private and internal fields
MemberWhat it is
private static readonly int _FillProgressShader property id for the fuel fill.
private static readonly int _NegativeChangeProgressShader property id driven by whether the target layer is known.
private Material animatingMaterialThis pip's own copy of the status material.
private float animationDurationSeconds a select fade takes (0.5 by default).
private CaveTeleportConnection connectionThe teleport connection this pip shows.
private float currentProgressCurrent select fade value, 0 to 1.
private Coroutine fadeThe running fade coroutine.
private bool isSelectedWhether the pip is selected.
private FloatEvent selectStrengthEvent called with the fade value, to drive the selected look.
private Renderer statusRendererRenderer whose material shows the pip's status.

Methods​

MemberWhat it is
void SetSelected(bool isSelected)Selects or deselects the pip and starts the fade if the state changed. No fade on a headless server.
void SetupConnection(CaveTeleportConnection connection)Binds the pip to a teleport connection, moving its listeners off any old one, and shows the current state.
4 private and internal methods
MemberWhat it is
private void Awake()Client: makes a tracked copy of the status material so this pip can animate on its own.
private IEnumerator Fade() (iterator)Coroutine that fades the select strength up or down over animationDuration, calling selectStrength each frame.
private void HasToChanged(bool hasTo)Sets the shader's negative change value when the target layer becomes known.
private void IsHasFuelToChanged(bool hasFuelTo)Sets the shader's fill value to show whether the target layer has enough fuel.

Used in​

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