private static void AddStage(string keyName, string path) { int count = stages.Count; for (int i = 0; i < EditorBuildSettings.scenes.Count(); i++) { string sceneName = Path.GetFileNameWithoutExtension(EditorBuildSettings.scenes[i].path); if (sceneName.Substring(0, sceneName.Length - 2) == keyName) { ReadScene readScene = new ReadScene(); readScene.name = sceneName; readScene.path = path; stages.Add(readScene); } } stages.Sort(count, stages.Count - count, null); }
static StageSelector() { //AddStage("TutorialStage", "Assets/Scenes/{0}.unity"); //AddStage("Stage", "Assets/Scenes/{0}.unity"); //AddStage("K.R.EasyStage", "Assets/Scenes/KRStage/{0}.unity"); //AddStage("K.R.MiddleStage", "Assets/Scenes/KRStage/{0}.unity"); //AddStage("K.R.HardStage", "Assets/Scenes/KRStage/{0}.unity"); //AddStage("N.EasyStage", "Assets/Scenes/NSStage/{0}.unity"); //AddStage("N.MiddleStage", "Assets/Scenes/NSStage/{0}.unity"); //AddStage("N.HardStage", "Assets/Scenes/NSStage/{0}.unity"); //AddStage("UXStage", "Assets/Scenes/UXStage/{0}.unity"); stageData = null; foreach (var scene in EditorBuildSettings.scenes) { ReadScene readScene = new ReadScene(); readScene.name = Path.GetFileNameWithoutExtension(scene.path); readScene.path = scene.path; stages.Add(readScene); } }