加入很多新内容,这波一块交了

This commit is contained in:
2026-04-08 20:53:41 +08:00
parent d9376833b6
commit 85dfff28dd
128 changed files with 14546 additions and 474 deletions
@@ -326,6 +326,9 @@ public class GameManager : MonoBehaviour
{
Debug.Log("GameManager Start() initialized");
// Move first-hit one-time setup cost into scene load instead of the first judged note.
StartCoroutine(PrewarmGameplayFirstHitPath());
// --- Initialize Statistics ---
currentSong = BeatmapManager.pendingSongData ?? SongDataHolder.SelectedSongData;
if (currentSong != null && !GameConfig.autoPlayEnabled)
@@ -489,6 +492,34 @@ public class GameManager : MonoBehaviour
}
}
private IEnumerator PrewarmGameplayFirstHitPath()
{
yield return null;
try
{
Note.PrewarmRuntimeCaches();
HoldNote.PrewarmRuntimeCaches();
var judgeFx = Animation_GenerateJudgementSituationPrefab.Instance
?? FindAnyObjectByType<Animation_GenerateJudgementSituationPrefab>();
judgeFx?.PrewarmJudgePrefabs(1);
var fxEvent = effectEventController.Instance ?? FindAnyObjectByType<effectEventController>();
if (fxEvent != null && fxEvent.isActiveAndEnabled)
{
// Cache target and pre-create SmoothShake via OnEnable/Awake path already present.
}
var globalFx = globalNoteEffect.Instance ?? FindAnyObjectByType<globalNoteEffect>();
globalFx?.PrewarmRuntime();
}
catch (System.Exception ex)
{
Debug.LogWarning($"[GameManager] Gameplay prewarm failed: {ex}");
}
}
private void Update()
{
// Detect Space or yellow note key to request start (only before gameplay starts)