Skip to main content

RespawnShrineFuelDisplay

A class in Root.Township, ATT.Respawn.

Shows a respawn shrine's fuel: a frozen copy of the fuel item, the fuel amount, and hover and particle effects while players are subscribed. Driven by PoweredRespawnShrine.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private TextRenderer fuelAmountText that shows the fuel amount.
private GameObject fuelConsumptionParticleParticle object shown while fuel is being used.
private Transform fuelDisplayTransformWhere the display copy of the fuel item is placed.
private GameObject fuelItemThe spawned display copy of the fuel item.
private HoverAnimator hoverAnimatorHover animation played while fuel is being used.

Methods​

MemberWhat it is
void UpdateDisplay(PickupDockSettings dockSettings, float currentShrinePower, int subscriberCount)Spawns the display item if needed and updates the amount text and consumption effects.
5 private and internal methods
MemberWhat it is
private void DisableFuelItemComponents()Makes the display copy of the fuel item non-interactable, non-networked, kinematic and without colliders.
private void OnDisable()Destroys the display copy of the fuel item.
private void SpawnFuelItem(PickupDockSettings dockSettings)Spawns a copy of the dock's first included item as the display item, once.
private void UpdateFuelConsumptionVisuals(int subscriberCount)Plays the hover animation and particles while the shrine has subscribers, and stops them otherwise.
private void UpdateQuantity(float currentShrinePower)Shows the fuel value rounded up as text.

Used in​

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