ExperienceFillVisualizer
A class in Root.Township, the global namespace.
Skill shrine visual that fills with a player's XP toward the next level on one path, and animates buying and selling skills. The server sends the values; clients animate.
- Listed in Global namespace: E to H
- Inherits or implements
SkillShrineVisualizer - Derived types
ProfessionDiskAvailablePointsVisualizer,ShrineStructureAvailablePointsVisualizer
Constructors
| Member | What it is |
|---|---|
ExperienceFillVisualizer() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
15 private and internal fields
| Member | What it is |
|---|---|
private static readonly int _FillProgress | Shader property ID for the main fill amount. |
private static readonly int _NegativeChangeProgress | Shader property ID for the fill shown while selling points. |
private static readonly int _PositiveChangeProgress | Shader property ID for the fill gained, shown while buying. |
private Coroutine animationCoroutine | The running fill animation, stopped before a new one starts. |
private AvailablePointVisualizerManager availablePointVisualizer | Shows the orbs for free skill points. |
private float currentFillValue | Current fill from 0 to 1, progress to the next level. |
private int currentFreePoints | Free skill points on this path, synced from the server. |
private AnimationCurve fillingCurve | Easing for that fill. |
private float fillToTargetTime | Seconds to fill to current progress after opening. Default 0.7. |
private bool hasSold | True once selling has gone past a full level and a temporary point orb is showing. |
private bool isOpen | True while the shrine is open for a player. |
private float openingAnimationTime | Seconds the per-point fill animation takes in total. Default 2. |
private Renderer rendererToAnimate | Backing field for RendererToAnimate, whose material gets the fill values. |
private AnimationCurve sellingProgress | Curve for how the fill moves while selling. |
private float soldFillProgress | Fill level after refunding experience by selling a point, worked out by the server in Serialize. |
Properties
| Member | What it is |
|---|---|
Renderer RendererToAnimate { get; } | The renderer whose fill shader values are animated. |
Methods
| Member | What it is |
|---|---|
override void Disable() | Empties the fill and hides the available points. |
void FinishBuy(bool wasConfirmed) | Animates the end of a buy, confirmed or cancelled. |
void FinishSell() | Clears the sell preview and restores the normal fill. |
override void PrepareOnServer(PlayerProgressionManager manager) | On a non-headless host, reads the player's progress and animates. |
override void Serialize(Stream stream, PlayerProgressionManager manager) | Server writes free points, fill toward the next level and the fill after a sale; clients read them and animate. |
void SetBuyProgress(float progress) | Shows the fill draining while a buy is held. |
void SetSellProgress(float progress) | Shows the fill rising toward the after-sale value while a sell is held. |
protected virtual void OpenInternal() | Hook for subclasses when the visualizer first opens. Empty in the base class. |
6 private and internal methods
Used in
Members of other types that take, return or hold a ExperienceFillVisualizer:
BoughtSkillOrbReplacer.RepositionAndAnchor, BoughtSkillOrbReplacer.visualizer, ProfessionsProgressShrine.availablePointsVisualizers, ProfessionsProgressShrine.GetVisualizer, ProfessionsProgressShrine.pathVisualizerPrefab, ProgressionShrine.GetVisualizer, SkillOrbOperator.fillVisualizer, SkillShrine.fillVisualizer, SkillShrine.GetVisualizer.