I don’t know the specific term to search for this.
Once the game is over, Let the game in the background visible. I just wanted to display the statistics of the game and option to restart the game or go back.
So, What is the concept to overlay something over the game?
Create a UI Panel in the scene with all the UI elements that you want in the game-over overlay (Create > UI > Panel). Keep this Panel disabled by default (from the Inspector). When it’s a game over you can set Panel’s SetActive(true); using it’s RectTransform.
public RectTransform OverlayPanel; //Drag and drop the reference to the Panel that you want to show in the overlay from the inspector
//Call this when it's a game over.
void ShowPanel()
{
//disable game movement or controls here
OverlayPanel.gameObject.SetActive(true);
}
Both can have one canvas each. Once the game is over you can use:
Application.LoadLevelAdditive(“StatisticsScene”);
It will be added as an overlay to the GameScene, make sure you have added a Panel control in StatisticsScene, so once it is added over the GameScene anything in GameScene is not clickable.
You should crate a Canvas and have it either disabled or have its Alpha set to 0 with raycasting and interactable disabled. When the game ends you could use a function call to activate the canvas which contains all your Texts, Images, buttons, and any stats you wish to have displayed.
Altering a canvases visibility and raycasting/interactability causes all the child objects to inherit this properties.