How to check if loading from another level or game start?

How do I determine if the first Unity scene is loaded because the application is just being opened, or because it was loaded from another scene?


I have a unity scene acting as my main menu and level selection screen. When the player runs the game initially (loading the webpage/launches app) I always want this main menu scene to open at the start screen.

However when this main menu scene is loaded from quitting one of the game’s levels, I want to load into the level select section instead.

Is there some variable that lets me check what called the level load? Thanks

Just keep an object saved with ‘DontDestroyOnLoad’ that holds all of this information.