Pillo UI navigation

This section explains how PilloTemplate UI works and what you need to know if you want to work with it. The core functionality scripts behind screen state are PT_Screen_State and PT_Screen. They are used to operate between different scenes and UI states.

Screen states

Screen states are the main states of your in game screen, they are used to either switch between different scenes or something like a pause screen. The scene MainUIScene has a parent object MainUI/States which contains 6 states (Background, MainMenu, Game, Pause, Tutorial and EndGame). Each state has a PT_ScreenState script attached, and you can see few public variables it has. OpenSceneName is the name of the scene to open when the state is opened, if left blank (ex. background/pause) it will overlay the existing scene (you can change depth of the state with Depth variable. OpenScreens is an array of the PT_Screen scripts, here you decide what UI screen are overlaid on the scene (ex. State_Main has a Background, Header, and Screen_Main screens, the are dragged and dropped from MainUI/MainUI and will be activated when the main menu screen state is open).


Screens are the different UI states when you browse something like menu/pause and highscores etc. In the MainUIScene you can find a parent object MainUI/MainUI where all screens are located, basically when you want a different UI state or overlay on the same scene you create a new screen here. Each screen has a PT_Screen script attached to it and has a variable Depth for layering purposes. You are free to activate/deactivate and change screens. Easiest way to explain simply is by an example.

Main menu cosists of a lot of states (Background/Header/Main/Options/Highscores/Callibration and a few confirm screens) all of those you can see in this parent object, and they are activated with buttons and screen states.

How the Interaction work

We are going to show you this on the same Main Menu example. Main menu has 5 buttons where each leads to something.

Play button has a script PT_Screen_Bt_State where the wanted screen state is dragged (in our case State_Game) and by click event the ButtonInteract function in the script is activated and the state is opened.

Tutorial button is the same as play, but has a different screen state (State_Tutorial).

Options and Highscores buttons on the other hand have a script PT_Screen_Bt_GoTo and will send you to another screen which is dragged and dropped from other screen object (ex. button Options has a screen Screen_Options in the target screen gotten from MainUI/MainUI/Screen_Options). Button Quit has the same functionality and sends you to quit confirm screen.

One more thing to note, PT_Screen_Bt_Back is a script which returns you to your previous screen and is placed on all back buttons in the screens.