How do I make a replay button? Custom switch of scenes?

The simplest way to make a custom scene change is by opening a state prefab. In PilloTemplate/Prefabs/States you have the prefabs of all screen states. So you create a public variable of type PT_ScreenState in your class where you want the functionality to happend, then drag and drop your wanted screen state from prefabs and force open it. Code below shows you the implementation.

public PT_ScreenState screen_state_to_open;

void OpenPrefabScreenState()
    {
        //-- force open dragged prefab screen state --//
        
        screen_state_to_open.Open(true);
    }  

How do I create additional screen / screen state / scene?

We are going to create a screen for level selection after you press play in main menu, new scene for second level and screen state prefab for it.

Go to MainUIScene, on the scene find MainUI/MainUI object, now you can create the screen from scratch using base button prefab (PilloTemplate/Prefabs/UI/BaseButton) and PT_Screen script, but easier way is just to copy one of the screens we have.

Let's copy screen MainUI/MainUI/Screen_Main, rename it to Screen_LevelSelection, delete Bt_Highscores,Bt_Quit and Bt_Options. Rename Bt_Play & Bt_Tutorial to “Bt_level_1” and “Bt_level_2”, change the buttons text accordingly. Next add a back button prefab (PilloTemplate/Prefabs/UI/Bt_Back) so we have a back option if we want to return to main menu.

The first level button is already sending us to GameScene, so let's create a new scene for second level, as well as, new state prefab for it.

Got to your scenes folder and create a new scene, name it, I named it GameScene_2 (also add this scene to your build settings).

Open MainUIScene, find your States object, copy State_Game and rename it to State_Game_2. In OpenSceneName write how you named your second scene, in my case GameScene_2. Drag and drop your newly created state, into states prefabs trajectory in PilloTemplate/Prefabs/States folder.

Now you can drag your new state into Bt_level_2 object, so button click will send you to second scene. Drag and drop your States/State_Game_2 into Bt_level_2/PT_Screen_Bt_State(script)/State(variable).

Next, let's change so our Play button in main menu sends us to elvel selection screen. Go to Screen_Main/Panel/Bt_Play remove PT_Screen_BtState script from button and add PT_Screen_Bt_GoTo script in place of it. Drag your Screen_LevelSelection screen into TargetScreen variable of added script. Last thing you need to do here is add OnClick event to the Bt_Play, click on you button object, fint OnClick() , drag or find the Bt_Play object into object category of OnClick() event, lastly select funtion to execute - PT_ScreenBt_GoTo.ButtonInteract().

Now open your GameScene_2, drag and drop UILoader and ManagerSetup prefabs into your scene (PilloTemplate/Prefabs), click on UILoader and drag your State_Game_2 prefab into FirstState variable of UILoader.

All done, play your MainMenuSceneand browse through levels.

There can be an issue when executing play mode of GameScenes before MainMenuScene, but everything should work after you build your project.