Hi everyone! Is it possible to create an array or list with selected scenes? I was wondering because I have been trying to randomize the next scene that will appear to a player (through a UI button) but that scene has to be part of a set list. Any suggestions?
You can put strings (scene names) into a list, which to me is the most straightforward way of organizing scenes. If you feel adventurous, look up ways of making a serializable screen reference, so you can drag/drop scenes into the editor inspector window. I've never bothered as it seems to add very little value to my own workflow. Strings are instantly repeatable and easy to reason about and debug.
Thanks for the quick reply! I found this: https://answers.unity.com/questions/1259567/load-a-random-scene-from-a-list-of-strings.html But I'm still confused by how the scenenames are converted into strings and added to the list directly.
If you're asking for a program way to get all the scene names, you can loop through the scenes using SceneManager. It has the property sceneCount and the method GetSceneAt(), which you can just get the name from the resulting scene object.