Skip to main content

ProgressionShrine

An abstract class in Root.Township, the global namespace.

Base for the skill shrine a player opens to see and spend progression points. Server opens it for one player and syncs who is using it and the visuals to clients.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private PlayerProgressionManager currentManagerBacking field for CurrentManager, the progression manager of the player using the shrine.
private MethodSync syncCurrentPlayerMessage (SyncD) for SyncCurrentPlayer. Sent to chunks on open and close, and to each player who connects.
private MethodSync syncVisualsMessage (SyncA) for SyncVisuals. Sent when the shrine opens or closes and when the player's free points change.

Properties​

MemberWhat it is
PlayerProgressionManager CurrentManager { get; private set; }Progression manager of the player using the shrine, or null.
bool IsOpen { get; private set; }True while a player is using the shrine.
abstract IEnumerable<SkillShrineVisualizer> Visualizers { get; }The visualizers that show each progression path.

Events​

MemberWhat it is
event PlayerHandler UpdatedPlayerRaised when the player using the shrine changes.

Methods​

MemberWhat it is
void Close()Closes the shrine, disables the visualizers and, on the server, syncs it.
abstract ExperienceFillVisualizer GetVisualizer(ProgressionPath path)Subclass: the experience fill visualizer for a path.
override void Initialize()Creates the syncs and closes the shrine if the entity is destroyed.
override void OnConnected(Player player)Sends the current user (and visuals if open) to a joining player.
void Open(IPlayer player)Server: opens the shrine for a player, closing it for anyone else first.
void Open(PlayerProgressionManager manager)Server: opens the shrine for a player, closing it for anyone else first.
void ToggleOpenClosedLocalPlayer(Player player)Closes the shrine if open, otherwise opens it for the given player.
protected abstract void CloseInternal()Subclass: work when closed.
protected abstract void OpenOnClient()Subclass: client-side work when the open state arrives.
protected abstract void OpenOnServer()Subclass: server-side work when opened.
protected virtual void UpdateVisuals(IPlayer player, ProgressionPath updatedPath)Server: refreshes the visualizers from the player's progress and syncs them.
3 private and internal methods
MemberWhat it is
private void DestroyDisable(NetworkEntity entity, bool isUnload)Closes the shrine if it is open when the entity is destroyed by the scene.
private void SyncCurrentPlayer(IPlayer player, Stream stream)Sends the identifier of the player using the shrine (0 when closed). Clients open or close the shrine to match.
private void SyncVisuals(IPlayer player, Stream stream)Serializes every visualizer's state for the current player while open. Clients disable all visualizers when it says closed.

Used in​

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