备份,准备做双端

This commit is contained in:
FloatGaming
2026-07-30 23:15:58 +08:00
parent add675e45d
commit ec4ec53545
88 changed files with 4050 additions and 872 deletions
@@ -37,6 +37,13 @@ public class LevelRuleController : MonoBehaviour
private int lastEchoCastSlot = -1;
private float lastEchoCastTime = -999f;
private float nextConfigResolveTime;
// The (song, difficulty) pair we have already run FindConfig for. Lets the periodic
// Update skip re-resolving (and re-running Resources.LoadAll) when the current song has
// NO matching config — otherwise activeConfig stays null and the null-check early-out
// never trips, re-scanning Resources every 0.5s for the whole song.
private SongData resolvedForSong;
private int resolvedForDifficulty = -1;
private bool hasResolvedForCurrent;
private int pendingSettlementScoreBonus;
private bool handlingEnemyDamagedActions;
@@ -145,6 +152,7 @@ public class LevelRuleController : MonoBehaviour
{
ResetRuntimeState();
nextConfigResolveTime = 0f;
hasResolvedForCurrent = false;
TryResolveActiveConfig(true);
}
@@ -160,10 +168,15 @@ public class LevelRuleController : MonoBehaviour
SongData song = beatmapManager.assignedSongData;
int difficulty = beatmapManager.assignedDifficulty;
if (!force && activeConfig != null && currentSong == song && currentDifficulty == difficulty)
// Skip re-resolving when we've already resolved for this exact (song, difficulty),
// regardless of whether a config matched (null result is still a resolved result).
if (!force && hasResolvedForCurrent && resolvedForSong == song && resolvedForDifficulty == difficulty)
return;
LevelRuleConfig_SO matched = FindConfig(song, difficulty);
resolvedForSong = song;
resolvedForDifficulty = difficulty;
hasResolvedForCurrent = true;
SetActiveConfig(matched, song, difficulty);
}