diff --git a/Assets/Scripts/Manager/ProjectLoader.cs b/Assets/Scripts/Manager/ProjectLoader.cs index d8b8fab5..9628bf46 100644 --- a/Assets/Scripts/Manager/ProjectLoader.cs +++ b/Assets/Scripts/Manager/ProjectLoader.cs @@ -16,7 +16,7 @@ namespace Ichni public float fakeLoadPercent; public float realLoadPercent; public float displayLoadPercent => Mathf.Min(realLoadPercent, fakeLoadPercent); - + public static readonly ES3Settings SaveSettings = new ES3Settings { compressionType = ES3.CompressionType.None, @@ -24,7 +24,7 @@ namespace Ichni format = ES3.Format.JSON, location = ES3.Location.Resources }; - + private static readonly ES3Settings LoadSettings = new ES3Settings { compressionType = ES3.CompressionType.Gzip, @@ -33,19 +33,19 @@ namespace Ichni format = ES3.Format.JSON, location = ES3.Location.Resources }; - + public void TestLoad() { - string beatMapFolderPath = "Beatmaps/" + InformationTransistor.instance.chapter.chapterIndex + - "/" + InformationTransistor.instance.song.songName + + string beatMapFolderPath = "Beatmaps/" + InformationTransistor.instance.chapter.chapterIndex + + "/" + InformationTransistor.instance.song.songName + "/" + InformationTransistor.instance.difficulty.difficultyName; - + LoadProjectInfo(beatMapFolderPath); LoadSongInfo(beatMapFolderPath); LoadCommandScripts(beatMapFolderPath); GameManager.Instance.gameLoadingCanvas.MoveParts(); - + ThemeBundleManager.instance.LoadThemeBundles(GameManager.Instance.projectInformation.selectedThemeBundleList); realLoadPercent = 0f; fakeLoadPercent = 0f; @@ -57,13 +57,13 @@ namespace Ichni .Subscribe(_ => { LoadBeatMap(beatMapFolderPath); - + IDisposable fakeLoadObserver = Observable.EveryUpdate().Subscribe(_ => { fakeLoadPercent += Time.deltaTime * 0.2f; GameManager.Instance.gameLoadingCanvas.SetProgress(displayLoadPercent * 100f); }); - + Observable.EveryUpdate() .Where(_ => ((BeatmapContainer_BM)GameManager.Instance.beatmapContainer.matchedBM).remainingElementAmount.Value == 0 && fakeLoadPercent >= 1f) @@ -90,15 +90,15 @@ namespace Ichni Observable.NextFrame().Subscribe(_ => { GameManager.Instance.timeDurations = GameManager.Instance.beatmapContainer.gameElementList - .Select(x=> (x as IHaveTimeDurationSubmodule)?.timeDurationSubmodule) - .Where(x => x != null && x.startTime > 0 && x.endTime < GameManager.Instance.songInformation.songLength).ToList(); + .Select(x => (x as IHaveTimeDurationSubmodule)?.timeDurationSubmodule) + .Where(x => x != null && (x.startTime > 0 || x.endTime < GameManager.Instance.songInformation.songLength)).ToList(); GameManager.Instance.beatmapContainer.gameElementList.ForEach(element => element.WhenStart()); }); }); }); }); }); - + /*Observable.EveryUpdate() .Where(_ => !GameManager.Instance.audioManager.isStarting) .First() @@ -107,11 +107,11 @@ namespace Ichni });*/ } - + public void Load(string chapterName, string musicName, string difficultyName) { string beatMapFolderPath = "Beatmaps/" + chapterName + "/" + musicName + "/" + difficultyName; - + LoadProjectInfo(beatMapFolderPath); LoadSongInfo(beatMapFolderPath); LoadCommandScripts(beatMapFolderPath); @@ -127,7 +127,7 @@ namespace Ichni private void LoadSongInfo(string beatMapFolderPath) { string songInfoPath = beatMapFolderPath + "/SongInfo.bytes"; - ES3.Load("SongInformation",songInfoPath, LoadSettings).ExecuteBM(); + ES3.Load("SongInformation", songInfoPath, LoadSettings).ExecuteBM(); } private void LoadBeatMap(string beatMapFolderPath) @@ -141,6 +141,6 @@ namespace Ichni string commandScriptsPath = beatMapFolderPath + "/CommandScripts.bytes"; ES3.Load("CommandScripts", commandScriptsPath, LoadSettings).ExecuteBM(); } - + } } \ No newline at end of file