Skip to main content

ServerSelectionOrb

A class in Root.Township, the global namespace.

Main-menu orb the player grabs and lets go of to act on the selected server in the server list. It can't be picked up while no server is selected.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private ActionOrb actionOrbThe ActionOrb the player grabs.
private ServerElement selectedElementThe server currently selected in the list.
private Transform selectionOrbPositionWhere the orb sits when not held.
private ServerElementEvent validOrbLetGoEvent fired with the selected server on a valid let-go.

Methods​

MemberWhat it is
void UpdateSelectionOrbBasedOnSelection(ServerElement newElement)Stores the new selection. If it's null, force-drops the orb.
3 private and internal methods
MemberWhat it is
private void Awake()Hooks the orb's pickup filter and valid let-go event, and sets its home position.
private void EnsureServerIsSelected(Interactor interactor, Interactable interactable, ref bool result)Pickup filter that blocks grabbing the orb while no server is selected.
private void LetGo()Fires validOrbLetGo with the selected server when the orb is let go in a valid place.