Hello,
I researched a way on how to get all the names of all the scene levels, but when I publish my game, I get compiler errors. Here is my code in javascript…
var names : List.<String> = new List.<String>();
names.Clear();
for (var S : UnityEditor.EditorBuildSettingsScene in UnityEditor.EditorBuildSettings.scenes) {
if (S.enabled) {
var name : String = S.path.Substring(S.path.LastIndexOf('/')+1);
name = name.Substring(0,name.Length-6);
names.Add(name);
}
}
The variable, ‘names’ will contain all the names of the levels I put in my build settings of my project. The game runs fine, but the problem happens when I try and publish my game. I get errors like…
The name ‘UnityEditor.EditorBuildSettingsScene’ does not denote a valid type (‘not found’). Did you mean ‘System.ComponentModel.EditorBrowsableAttribute’?