加入很多新内容,这波一块交了
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user