Well, you can use Selection Grind for the 3 alternatives you have.
private string[] timeOfDayOptions = new string[] { "Night", "Day" };
private string[] traficOptions = new string[] { "Low", "Medium", "High" };
private string[] pedestianOptions = new string[] { "Low", "Medium", "High" };
private int timeOfDay;
private int trafic;
private int pedestian;
void OnGUI() {
// Draw 3 selection grids with all options. Each Grid can only have one option active
timeOfDay = GUI.SelectionGrid(new Rect(25,25,200,25), timeOfDay, timeOfDayOptions, 1);
trafic = GUI.SelectionGrid(new Rect(25,50,200,25), trafic, traficOptions, 1);
pedestian = GUI.SelectionGrid(new Rect(25,75,200,25), pedestian, pedestianOptions, 1);
if(GUI.Button(new Rect(25, 100, 100,25), "Start Level")) {
string levelName = "FreeRoam"+timeOfDayOptions[timeOfDay]+traficOptions[trafic]+pedestianOptions[pedestian];
Application.Load(levelName);
}
}
This way the string will only be created
a) shortly before needed
b) only when the users hits the Start Level button.
Edit:
Also, if you want to save the settings “live” as the user change it, you can use the GUI.changed property to see if any input has been changed since last UI draw/GUI operation
void OnGUI() {
// Draw 3 selection grids with all options. Each Grid can only have one option active
timeOfDay = GUI.SelectionGrid(new Rect(25,25,200,25), timeOfDay, timeOfDayOptions, 1);
trafic = GUI.SelectionGrid(new Rect(25,50,200,25), trafic, traficOptions, 1);
pedestian = GUI.SelectionGrid(new Rect(25,75,200,25), pedestian, pedestianOptions, 1);
if(GUI.changed) {
// User has changed some UI input/settings
PlayerPrefs.SetString("Blah", timeOfDay);
....
}
if(GUI.Button(new Rect(25, 100, 100,25), "Start Level")) {
string levelName = "FreeRoam"+timeOfDayOptions[timeOfDay]+traficOptions[trafic]+pedestianOptions[pedestian];
Application.Load(levelName);
}