<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />
Navigation
</aside>
π Home Page
<aside>
π‘ The whole game UI lives in the Game scene as pages. Each page is a canvas with a UIPage component. UIController from Watermelon Core shows and hides the pages.
</aside>

Page prefabs are stored in Assets/Project Files/Game/Prefabs/UI/Canvas.
| Page | Class | Role |
|---|---|---|
| UI Start Screen | UIStartScreen |
Pre-run screen. Upgrade slots, pre-run modifier button, progression, settings and no-ads buttons, coin and gem balances, the tap to start area. |
| UI Launch | UILaunch |
Aim phase. Hosts the aim input panel for the launcher of the level, the pull indicator and the Back button. |
| UI Game | UIGame |
Run HUD. Contains RunHUD, the active booster HUD and the Restart button. |
| UI Run Result | UIRunResult |
End of a run. See β£. |
| UI Level Complete | UILevelComplete |
End of a level. |
| UI Progression | UIProgression |
List of levels with the unlock animation. See β£. |
| UI Pre Run Modifiers | UIPreRunModifiersPopup |
Popup with the three modifier slots. See β£. |
| UI Game Settings | UISettings |
Settings popup. See β£. |
| UI No Ads Pop Up | UINoAdsPopUp |
Popup with the remove ads purchase. |
Start Screen ββtapβββΆ Launch ββreleaseβββΆ Game ββendβββΆ Run Result ββcontinueβββΆ Start Screen
β β ββfinishββΆ Level Complete ββcontinueβββΆ next level
ββ Progression ββ Back ββΆ Start Screen
ββ Pre Run Modifiers (popup)
ββ Settings (popup)
ββ No Ads (popup)
GameController shows the pages with UIController.ShowPage<T>() and subscribes to the page events (OnTapToStart, OnBackPressed, OnRestartPressed, OnContinuePressed).
| Method | Description |
|---|---|
ShowPage<T>() |
Shows a page and runs OnShow. |
HidePage<T>(callback) |
Hides a page and runs OnHide. |
GetPage<T>() |
Returns the page of the type. |
HasPage<T>() |
Checks that the page exists. |
IsDisplayed<T>() |
Checks that the page is shown. |
IsPopupOpened |
Checks whether any popup is open. |
PageOpened, PageClosed, PopupOpened, PopupClosed |
Events. |
GameController.Awake calls uiController.Init(). It caches the references and discovers the pages.uiController.InitPages() calls Init() on every page. Pages can use all modules here.| Member | Description |
|---|---|
Init() |
Abstract. Bind buttons and subscribe to events. |
OnShow() |
Abstract. Play the show animation and call NotifyOpened() at the end. |
OnHide() |
Abstract. Play the hide animation and call NotifyClosed() at the end. |
OnUnload() |
Optional cleanup. |
IsPopup |
true for a popup. UIController tracks open popups. |
IsPausePopup |
true to set Time.timeScale to 0 while the popup is open. Requires IsPopup. |
Pages use the animation helpers UIFadeAnimation and UIScaleAnimation. A pause popup must run its animations on unscaled time.
Register the main rect transform of every page with SafeAreaAdapter.RegisterRectTransform(safeAreaRectTransform) in Init, so the content stays inside the safe area of the device.
Overlay.Show(duration, callback) fades the screen to black and calls the callback. Overlay.Hide(duration) fades it back. GameController uses it to hide the reset of the run and the load of the next level.
UIStartScreen raises OnTapToStart. It also refreshes the No Ads button when AdsManager.ForcedAdDisabled fires, plays the coin cloud with the run reward and resets the gem offers of the upgrade slots at every new run.