改一个点:

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 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_BM>("SongInformation",songInfoPath, LoadSettings).ExecuteBM();
ES3.Load<SongInformation_BM>("SongInformation", songInfoPath, LoadSettings).ExecuteBM();
}
private void LoadBeatMap(string beatMapFolderPath)
@@ -141,6 +141,6 @@ namespace Ichni
string commandScriptsPath = beatMapFolderPath + "/CommandScripts.bytes";
ES3.Load<CommandScripts_BM>("CommandScripts", commandScriptsPath, LoadSettings).ExecuteBM();
}
}
}