ServerElement
A class in Root.Township, the global namespace.
One entry on the main menu's server list: shows a server's name, player count and playability colour, and can be selected.
- Listed in Global namespace: S
- Inherits or implements
Interactable,IBuildRendererPostBake,IBuildBakeable - Derived types
ServerElementEvent,ServerElementUnityEvent
Constructors
| Member | What it is |
|---|---|
ServerElement() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
| Member | What it is |
|---|---|
private ServerSelectionDisplay display | The server selection display this element belongs to, set by SetDisplay. |
private ToggleEvent elementSelected | Toggle event invoked with the selected state in SetSelected. |
private bool isConnectingToServer | Inspector button: when ticked, joins the shown server through VrMainMenu. |
private bool isInstancedMaterials | True once SetupForServer has made instanced materials for the playability renderers. |
private TextRenderer numberOfPlayersText | Text showing the server's online player count. |
private Renderer[] playabilityRenderers | Renderers tinted by the server's playability using the menu settings gradient. |
private Renderer rendererToSelect | Renderer whose material swaps between selected and normal. |
private TextRenderer serverNameText | Text showing the server name. |
Properties
| Member | What it is |
|---|---|
GameServerInfo ServerInfo { get; private set; } | The server shown. |
Methods
| Member | What it is |
|---|---|
void Select() | Selects this entry on its display, if it is interactable. |
void SetDisplay(ServerSelectionDisplay display) | Sets the list this entry belongs to and deselects it. |
void SetSelected(bool isSelected) | Shows the entry as selected or not. |
void SetupForServer(GameServerInfo server) | Fills the entry from a GameServerInfo. |
protected override void OnValidate() | Editor: the inspector's connect button joins the shown server. |
2 private and internal methods
Used in
Members of other types that take, return or hold a ServerElement:
CubeMapUpdater.SetupServer, SelectedElementChanged.BeginInvoke, SelectedElementChanged.Invoke, ServerBoard.OnSelectedChanged, ServerBoard.serverDisplays, ServerBoard.serverElementPrefab, ServerBoard.serverElements, ServerInfoBoard.SetServer, ServerSelectionDisplay.AddServerElement, ServerSelectionDisplay.CurrentSelection, ServerSelectionDisplay.OnSelectionChanged, ServerSelectionDisplay.RemoveServerElement, ServerSelectionDisplay.SelectElement, ServerSelectionDisplay.serverElements, ServerSelectionDisplay.ServerElements, ServerSelectionMenu.JoinCurrentServer, ServerSelectionMenu.OnSelectedChanged, ServerSelectionMenu.serverElementPrefab, ServerSelectionOrb.selectedElement, ServerSelectionOrb.UpdateSelectionOrbBasedOnSelection, ServerSelector.AnimateGaugeProgress, ServerSelector.NewServerElementSelected, ServerSelector.OnSelectionFinished, ServerSelector.OnServerDeselected, ServerSelector.OnServerDisplaySettled.