Hi,
I am making a game with 3 levels.
I have a Main Menu Scene with 4 panels
MainMenu - Main Panel
Start - Levels Panel
Help - Help Panel
Audio - Audio Panel
Quit
Clicking on Start takes me to the Levels panel with 4 buttons
Level 1 - interactable
Level 2 - not interactable (for now)
Level 3 - not interactable (for now)
Back
What I want to do is once I finish Level 1, it should come back to the Main Menu Scene with the Levels panel opened and the Level 2 button should be made interactable.
I hope I have made myself clear.
Kindly help.
Well, what I usually do for this type of thing (handling multiple canvas setups for different scenes) is instead of destroying the canvas and loading the new scene (what happens when you switch scenes) with another canvas, is I put all the canvas components under one canvas, and disable/enable panels of the canvas, such as a main menu panel, an “in game” panel, and maybe other stuff like a settings panel… credits panel… so on.
Then you do DontDestroyOnLoad() on the canvas, to maintain it across scenes, and don’t go back to the initial scene after loading the further scenes. Have one scene contain the canvas, then immediately switch to a main menu scene thats empty, and when selecting to start the game/app, go to the play scene, always maintaining the same canvas.
If you end up with a really complicated set of canvas objects (many different panels and individual things) this could get out of control, but in almost every game this has worked pretty well for me.
You could just save out to playerprefs what level they last cleared. If they are able to quit and come back and resume from the last level cleared, you’ll need to save out anyways. So at the start, no levels cleared. So level 1 is ready. Then after they clear that. Set playerpref to 1 and level 2 is ready. etc.
You might wann watch the Adventure Game Tutorial in which a persistent scene is used for the UI and loading of different scenes.