Skip to main content

GymnasiumTeleportPointPage

A class in Root.Township, ATT.FeatureTestGymnasium.

Client tablet panel in the feature test gymnasium that lists every non-default SpawnArea in pages and teleports the local player to the one picked.

Constructors​

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

Fields​

6 private and internal fields
MemberWhat it is
private ButtonWithEvents backButtonButton that goes to the previous page.
private int currentPageZero-based index of the page being shown.
private Action despawnTabletAction passed to Setup that removes the tablet after a teleport.
private ButtonWithEvents forwardButtonButton that goes to the next page.
private TeleportPointElement[] teleportListElementsThe fixed list elements on the panel. Their count is the page size.
private SpawnArea[] teleportPointsAll spawn areas found by Setup, sorted by identifier name.

Properties​

1 private and internal property
MemberWhat it is
private int PageOffset { get; }Index of the first spawn area on the current page.

Methods​

MemberWhat it is
void Setup(Action despawnTablet)Finds all spawn areas except the default one, sorts them by identifier and shows the first page. Takes the action that despawns the tablet.
11 private and internal methods
MemberWhat it is
private void ClearElement(TeleportPointElement view)Clears and hides one list element and unhooks its selection handler.
private void DisplayNoSpawnPoints()Hides all list elements and both page buttons when there are no spawn areas.
private bool HasNextPage()True when there are more spawn areas after the current page.
private void OnPageBackwards(Button obj)Back button handler: shows the previous page.
private void OnPageForward(Button obj)Forward button handler: shows the next page.
private void OnTeleportPointSelected(ListElementWithButton element)Despawns the tablet and moves the local player to a random position in the chosen spawn area.
private void ResetPanel()Clears every list element.
private void SetupElement(TeleportPointElement view, SpawnArea spawnPoint)Fills one list element with a spawn area, hooks its selection handler and shows it.
private void SetupNavigationButtons()Shows and hooks the forward and back buttons only when there is a page in that direction.
private void SetupTeleportPointElements()Fills the list elements with the spawn areas for the current page.
private void UpdatePageView(int page)Switches to the given page and redraws the list and buttons.

Used in​

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