Go back and forth between procedurally generated levels?

I’m creating a procedurally generated maze with multiple levels. I already have the code for generating the maze; that’s not the issue.

The issue is I need the player to be able to backtrack to the entrance of the first level of the maze from any level, so all of the levels need to be saved (as scenes, I assume) but I don’t want a fixed number of levels, so making a list of scenes in the build settings doesn’t seem like the way to go. It seems like this should be simple but, being a noob, I just can’t figure out how.

Maybe I’m just searching with the wrong keywords, but so far I’m only finding tutorials for procedural map generation or going back and forth between preexisting scenes listed in the build settings.

Not much information here about your procedural levels. Typically levels like these are generated from random values. Generate and save a seed for the Random class. Using the same seed should generate the same level. You can use PlayerPrefs to save the seed for each level, or if it is only during a single run of the app, you can use DonDestroyOnLoad:

“Just” save all the information bout a level in a file (size, block information, objects, player start positions etc.) and when you need to change a level, you first clear the scene and then generate the new level by looking up the informtion from your file. In effect, you have only one Unity scene which gets used for building any level when needed.