修了很多bug和增加功能,优化不少问题

This commit is contained in:
2026-02-28 06:59:22 +08:00
parent 508a40bba0
commit e11cc1da7a
345 changed files with 173803 additions and 69332 deletions
@@ -10,6 +10,9 @@ public class JudgeManager : MonoBehaviour
public settlementController sc;
public NoteSpawner ns;
[Header("Settlement Delay")]
[SerializeField] private float settlementEnterDelaySeconds = 1.5f;
private bool _cachedIsDebugEnabled;
private void UpdateDebugCache()
{
@@ -84,7 +87,20 @@ public class JudgeManager : MonoBehaviour
return;
}
// Activate settlement UI so components run their lifecycle, then call update next frame
// Enter settlement after a real-time delay to leave a short idle window after chart end.
StartCoroutine(InvokeSettlementUpdateNextFrame());
}
private IEnumerator InvokeSettlementUpdateNextFrame()
{
// Keep settlement lead-in fixed at 1.5s for consistent pacing.
float delay = 1.5f;
if (delay > 0f)
{
yield return new WaitForSecondsRealtime(delay);
}
// Activate settlement UI so components run their lifecycle.
try
{
settlement_go.SetActive(true);
@@ -94,19 +110,15 @@ public class JudgeManager : MonoBehaviour
if (IsDebugEnabled) Debug.LogWarning($"[JudgeManager] Failed to activate settlement_go: {ex}");
}
// Try to resolve settlementController reference if missing
// Try to resolve settlementController reference if missing.
if (sc == null && settlement_go != null)
{
sc = settlement_go.GetComponent<settlementController>() ?? settlement_go.GetComponentInChildren<settlementController>(true);
}
// Invoke the settlement update on next frame to ensure UI initialization finished
StartCoroutine(InvokeSettlementUpdateNextFrame());
}
// Wait one frame to allow Awake/Start/OnEnable.
yield return null;
private IEnumerator InvokeSettlementUpdateNextFrame()
{
yield return null; // wait one frame to allow Awake/Start/OnEnable
if (sc != null)
{
try