改一个点:

Signed-off-by: TRADER_FOER <lhf190@outlook.com>
This commit is contained in:
2026-07-10 11:28:11 +08:00
parent d474a8929c
commit cb65318bc0

View File

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