ActionGameManager.RunLive gates the renderer's Update paths too

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Nibu 2026-11-13 13:56:16 +00:00
commit 796a7af9ef
2 changed files with 6 additions and 2 deletions

View file

@ -106,6 +106,9 @@ public class ActionGameManager : MonoBehaviour
}
public static Galaxy CurrentGalaxy;
// Whether a run is live: a failed start and a finished run both clear the galaxy, and the scene's update paths (this
// manager's, the renderer's) step and draw nothing without one.
public static bool RunLive => CurrentGalaxy != null;
// The scenario a new run starts from: MainMenu.Launch sets it, and StartGame's new-run branch consumes it once.
public static Scenario PendingScenario;
@ -1339,8 +1342,7 @@ public class ActionGameManager : MonoBehaviour
void Update()
{
// No live run (a start that failed, a run that ended): the main menu is up, and nothing steps a zone or reads a player.
if (CurrentGalaxy == null) return;
if (!RunLive) return;
if(!_paused)
{
_time += Time.deltaTime;

View file

@ -508,6 +508,7 @@ public class ZoneRenderer : MonoBehaviour
void LateUpdate()
{
if (!ActionGameManager.RunLive) return;
Map.Draw(Zone, ActionGameManager.Clock.Lead);
}
@ -550,6 +551,7 @@ public class ZoneRenderer : MonoBehaviour
void Update()
{
if (!ActionGameManager.RunLive) return;
var lead = ActionGameManager.Clock.Lead;
GravityLowering.Lower(Zone, lead, ref _gravityWells);
foreach (var loot in _floatingItems.Values)